Skip to content

Commit

Permalink
Add hidden docs pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Bwc9876 committed Apr 24, 2022
1 parent 579a35a commit 7d43ffa
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 36 deletions.
19 changes: 19 additions & 0 deletions .idea/runConfigurations/Generate___Linux.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/runConfigurations/Generate___Windows.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Setup

You will need the pipenv venv manager installed:

```shell
$ pip install pipenv --user
```

Once pipenv is installed, run the following to set up a dev environment:

```shell
$ pipenv install --dev
```

# Building Documentation

Since the documentation is built with the package itself we use it for general testing.

To set up:

```shell
$ pip install . --editable
```

Will install the package to your venv and watch for changes.

## Schemas

You will also need to manually copy over the schemas folder from `menagerie/schemas/` to `docs/content/pages/schemas`, this is part of the run config on PyCharm already.

## Generating

Now, navigate to `docs/` and run the generate command to build.

```shell
$ python -m menagerie generate
```

## Note for PyCharm users

You're going to want to set `URL_PREFIX` to `/menagerie/docs/out/` if you plan on using the built-in web server.
(A run config is included with the repo)

## Note for CLI users

You're going to want to set `URL_PREFIX` to the absolute path to `docs/out/` if you want to do everything from command line.
33 changes: 4 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,11 @@ A static site generator that supports:
- XML Schemas
- YAML Schemas (Coming soon)

# Setup
# Documentation

Install the package via your favorite virtual environment manager:
Documentation for how to use menagerie is located at [https://bwc9876.github.io/menagerie/]

```shell
pipenv install menagerie-docs
```

Run the `start_project` command
# Contributing

```shell
python -m menagerie start_project MySite
```

This will create a `content/` folder as well as a `config.json` within a folder called `MySite`.

Also, you may want to add `./m_cache` to your .gitignore

# Building

To generate the site, run the following:

```shell
python -m menagerie generate
```

This will output to a folder named `out/`; to view the site open the generated `index.html` in your browser.

## Custom Config Path

```shell
python -m menagerie generate --config=PATH/TO/CONFIG
```
To contribute to menagerie, take a look at (CONTRIBUTING.md)[https://github.com/Bwc9876/menagerie/CONTRIBUTING.md]
4 changes: 2 additions & 2 deletions docs/content/pages/hidden.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Hide_In_Nav: True
Render_TOC: False


# Cow
# Secret

Hidden Page Yay!
You found a secret page!
8 changes: 4 additions & 4 deletions docs/content/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Menagerie docs is a python package used to generate static sites from a *menager
To get started, install `menagerie-docs` with your package manager

```shell
pip install menagerie-docs
$ pip install menagerie-docs
```

# Starting a project

Once installed, you can use the `new-project` command

```shell
python -m menagerie new-project MyCoolDocsSite
$ python -m menagerie new-project MyCoolDocsSite
```

This will create a new folder called `MyCoolDocsSite` with the following contents:
Expand All @@ -37,13 +37,13 @@ This will create a new folder called `MyCoolDocsSite` with the following content
To generate the site, run the `generate` command

```shell
python -m menagerie generate
$ python -m menagerie generate
```

You can also specify a different config file with the `--config` option

```shell
python -m menagerie generate --config=my-config.json
$ python -m menagerie generate --config=my-config.json
```

# Next steps
Expand Down
7 changes: 6 additions & 1 deletion docs/content/pages/pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,18 @@ Uses xml comments; create comments near the top of the file that look like this

# Metadata Reference

**Note:** These are all case-insensitive

{% set secret_link='Hidden Page'|route %}

| **Name** | **Description** | **Default** |
|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|
| **Title** | The title of this page, displayed in many places and used in metadata. Also what you pass to `route`. This is case-insensitive so make sure not to make duplicate titles | Derives from filename if nothing is provided |
| **Description** | The description of this page, appears in social media embeds and metadata | Description specified in `config.json` |
| **Sort_Priority** | How much to prioritize this page in the navbar, should be from 0-100. | 30 |
| **Render_TOC** | Whether to render a table of contents on this page (HTML/MD Pages only) | True |
| **Out_File** | Name of output file, omit the file extension | Same as name of source file |
| **Hidden_In_Nav** | Whether to hide this page in the navbar (this site [has one]({{ secret_link }})) | False |

# Linking to Pages

Expand Down Expand Up @@ -136,7 +141,7 @@ You can also specify one for schemas only.
To create groups of pages (dropdowns in the navbar), create folders in the `pages` folder. For example if I want a
dropdown for all of my schemas I might lay out my `pages` folder like so:

```file
```txt
- index.md
- schemas/
- my_schema.json
Expand Down
2 changes: 2 additions & 0 deletions docs/content/pages/static_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ If you need the full url for whatever reason, you can use the `full_url` filter
<img alt="My Cool Absolute Image" src="{{ '{{' }} 'images/my_image.png'|static|full_url {{ '}}' }}"/>
```

You can also pass in a value of `False` to this filter to not append the `URL_PREFIX` environment variable

# Minification

JS and CSS files are minimizes automatically. (this can be disabled in `config.json`). You do not need to worry about
Expand Down

0 comments on commit 7d43ffa

Please sign in to comment.