Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation #34

Merged
merged 10 commits into from May 16, 2021
Merged

Add documentation #34

merged 10 commits into from May 16, 2021

Conversation

br3ndonland
Copy link
Owner

Description

This PR will add a documentation website for inboard. The site is built with Material for MkDocs.

Changes

Material for MkDocs

  • Add dependencies for docs (05202f5)
  • Create MkDocs site (20065b8)
  • Configure MkDocs site (22122c7)
  • Add docs homepage (e0f9ed0)
  • Add inboard logo to docs (ebfb59d)
  • Add favicon from Material for MkDocs (8257c86)
  • Refactor README.md and CONTRIBUTING.md into docs (eb8d592)
  • Add logging configuration behavior and design docs (4abb085)
  • Add authentication docs (c7b98dd)

Deployment

  • Add Vercel config (611b204)
  • MkDocs and Material for MkDocs include built-in support for GitHub Pages deployments. I appreciate this feature, but opted not to use it here out of personal preference for Vercel. Once the docs/ directory is merged to the default branch (develop), Vercel deployments will be activated.

Related

#3
#22
#32

https://squidfunk.github.io/mkdocs-material/creating-your-site/

❯ mkdocs new .
  INFO    -  Writing config file: ./mkdocs.yml
  INFO    -  Writing initial docs: ./docs/index.md
https://squidfunk.github.io/mkdocs-material/creating-your-site/#configuration

`edit_uri`

- `edit_uri: ""` disables the "Edit on GitHub" button
  https://squidfunk.github.io/mkdocs-material/setup/adding-a-git-repository/

`markdown_extensions`

- `pymdownx.inlinehilite`: code block highlighting
  https://squidfunk.github.io/mkdocs-material/reference/code-blocks/

`theme`

- colors: `primary` is header bar, `accent` is within page text, media
  queries allow for light/dark theme based on browser preference
  https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/
- `font: false`: don't load Google fonts
  https://squidfunk.github.io/mkdocs-material/setup/changing-the-fonts/
- `icon`: refers to icons bundled with mkdocs-material
  https://squidfunk.github.io/mkdocs-material/setup/changing-the-logo-and-icons/
#22
https://gist.github.com/br3ndonland/d66ce3c8e98cf8bd4f3c24d006409e41

This commit will add the inboard logo SVG to the docs directory. As
described in #22, the logo was produced with Figma.
Figma wasn't exporting the Gunicorn logo correctly, but it is now fixed.

In Figma, the Gunicorn logo stroke was changed from inside to center, as
recommended here: https://forum.figma.com/t/svg-export-issue/3424

The Starlette and Uvicorn logo sources are PNG. Figma base64-encodes PNG
sources into SVG exports, which results in large file sizes.

To reduce the size of the exported logos, they were converted to vectors
with the Figma image tracer plugin. This conversion reduces the size of
the inboard logo SVG by 10x (>900 kb -> 90 kb).

https://www.figma.com/community/plugin/735707089415755407/Image-tracer
This commit will refactor README.md and CONTRIBUTING.md into docs pages.

Admonitions are used to set off tips and notes.
https://squidfunk.github.io/mkdocs-material/reference/admonitions/

It appears that MkDocs requires four-space tab indentations in order to
properly render Markdown lists, so an additional Prettier config will be
added to specify the `tabWidth`.
#3

- Explain default logging behavior
- State goal of simplifying Uvicorn+Gunicorn+Starlette/FastAPI logging
- Justify why inboard only accepts dictionary configurations for logging
@codecov
Copy link

codecov bot commented May 16, 2021

Codecov Report

Merging #34 (611b204) into develop (adcdecc) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           develop       #34   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          271       271           
=========================================
  Hits           271       271           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update adcdecc...611b204. Read the comment docs.

@br3ndonland br3ndonland merged commit 897ae29 into develop May 16, 2021
@br3ndonland br3ndonland deleted the docs branch May 16, 2021 22:38
@br3ndonland
Copy link
Owner Author

Documentation is now deployed to inboard.bws.bio and inboard.vercel.app.

Vercel build configuration:

  • Build command: python3 -m pip install 'mkdocs-material>=7.0.0,<=8.0.0' && mkdocs build --site-dir public
  • Output directory: public (default)

Vercel site configuration is specified in vercel.json.

br3ndonland added a commit that referenced this pull request Jul 5, 2021
#34

mkdocs-material was an optional dependency, so it could be installed
without dev dependencies when deploying the docs. However, it's easier
to install with `pip`. The following commands build docs with Vercel.

```sh
python3 -m pip install 'mkdocs-material>=7.0.0,<=8.0.0'
mkdocs build --site-dir public
```
br3ndonland added a commit that referenced this pull request Jul 5, 2021
#34

Admonitions are used to set off tips and notes.
https://squidfunk.github.io/mkdocs-material/reference/admonitions/

- Use regular Markdown for shell code blocks
- Use the "example" admonition for source code
- Add custom admonition titles where useful
br3ndonland added a commit that referenced this pull request Jul 7, 2021
#34

Minor change that helps preserve syntax highlighting in VSCode
br3ndonland added a commit that referenced this pull request Jul 7, 2021
#34
36eca9d
a877045

https://www.mkdocs.org/user-guide/configuration/#site_url
https://www.mkdocs.org/user-guide/configuration/#use_directory_urls
mkdocs/mkdocs#2189
mkdocs/mkdocs#2360

https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/
squidfunk/mkdocs-material#2520

MkDocs recently made the `site_url` setting required. A warning is now
seen when `site_url` is not included in mkdocs.yml:

```text
WARNING  -  Config value: 'site_url'.
            Warning: This option is now required. Set to a valid URL
            or an empty string to avoid an error in a future release.
```

The docs describe the `site_url` setting as follows:

> Set the canonical URL of the site. This is a required setting. If the
> 'root' of the MkDocs site will be within a subdirectory of a domain,
> be sure to include that subdirectory in the setting
> (https://example.com/foo/). If the domain is yet to be determined, you
> may use a placeholder domain, which will need to be updated prior to
> deployment.
>
> If the built site will not be behind a server, then you may set the
> value to an empty string (''). When set to an empty string, some
> features of MkDocs may act differently. For example, the
> `use_directory_urls` setting must be set to false.

If the docs are "behind a server," they often have more than one URL.
Which should be set as the `site_url`? Furthermore, if the related
`use_directory_urls` is set to `true`, it appends a trailing slash to
the URLs generated for the ToC (Table of Contents).

This commit will set `site_url: ""` and `use_directory_urls: false`.
In combination with the `{"cleanUrls": true, "trailingSlash": false}`
settings in vercel.json, the previous behavior of URLs and navigation
will be restored.
br3ndonland added a commit to br3ndonland/fastenv that referenced this pull request Jul 7, 2021
#1
br3ndonland/inboard#34
br3ndonland/inboard@9943112

https://www.mkdocs.org/user-guide/configuration/#site_url
https://www.mkdocs.org/user-guide/configuration/#use_directory_urls
mkdocs/mkdocs#2189
mkdocs/mkdocs#2360

https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/
squidfunk/mkdocs-material#2520

MkDocs recently made the `site_url` setting required. A warning is now
seen when `site_url` is not included in mkdocs.yml:

```text
WARNING  -  Config value: 'site_url'.
            Warning: This option is now required. Set to a valid URL
            or an empty string to avoid an error in a future release.
```

The docs describe the `site_url` setting as follows:

> Set the canonical URL of the site. This is a required setting. If the
> 'root' of the MkDocs site will be within a subdirectory of a domain,
> be sure to include that subdirectory in the setting
> (https://example.com/foo/). If the domain is yet to be determined, you
> may use a placeholder domain, which will need to be updated prior to
> deployment.
>
> If the built site will not be behind a server, then you may set the
> value to an empty string (''). When set to an empty string, some
> features of MkDocs may act differently. For example, the
> `use_directory_urls` setting must be set to false.

If the docs are "behind a server," they often have more than one URL.
Which should be set as the `site_url`? Furthermore, if the related
`use_directory_urls` is set to `true`, it appends a trailing slash to
the URLs generated for the ToC (Table of Contents).

This commit will set `site_url: ""` and `use_directory_urls: false`.
In combination with the `{"cleanUrls": true, "trailingSlash": false}`
settings in vercel.json, the previous behavior of URLs and navigation
will be restored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant