Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.37 KB

File metadata and controls

47 lines (36 loc) · 1.37 KB

GenIndex As module

GenIndex can be use as module to provide greter control over generation of pages.

How to use 🤔

  1. Clone the git repo into your system.

    git clone https://github.com/openPackageTools/GenIndex.git

    or download repo as zip file

    Screenshot 2022-12-26 004604

  2. Create python file and import GenIndex module

    import GenIndex

    You can also import GenIndex class directly

    from GenIndex import GenIndex

    For this guide we will follow first approch

  3. Create an object of GenIndex class. There are many options to customize the object but we use default for now. Default option generates Html pages with default card items.

    import GenIndex
    gen = GenIndex.GenIndex()
  4. Call gen_index(root_dir) method with path to root directory as argument.

    import GenIndex
    gen = GenIndex.GenIndex()
    gen.gen_index("./site/tutorials")
  5. Check the directory you provided and open index.html file inside that.

  6. Yeah! 🥳 you did it 🙌.

Note: If you already have a index.html file your dir them you don't see any changes because by default GenIndex didn't override existing file to
avoid acidental deletion of you site😬