Skip to content

Commit

Permalink
Added LICENSE, updated README & .env.example
Browse files Browse the repository at this point in the history
  • Loading branch information
Denperidge committed Jan 20, 2023
1 parent d23ff64 commit f900dd8
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
USERORORG=Denperidge-Redpencil
REPOS=Denperidge-Redpencil/mu-project,Denperidge-Redpencil/mu-cl-resources@master,doctest
REPOS=Denperidge-Redpencil/mu-project@master,Denperidge-Redpencil/mu-cl-resources,denperidge-redpencil/doctest@main,divio-docs-gen
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Denperidge

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
conflicting repo names: merge
# Divio Docs Generator

We could make the dedicated repo be partially auto-generated into the following structure
Automatically collect, aggregate and structure all your [divio-style documentation](https://documentation.divio.com/) into a tree of .md files.
```
/{reponame}
/tutorials
/how-tos
/explanations
/references
```

(I will be referring to [tutorials, how-tos, explanations, references] as sections)
- Any input structure: this script will scan your entire repository for .md files
- If you have a how-to section in your README, that'll get extracted and put in the right spot
- Or, if you have an how-to.md file, it'll get added in its entirety!
- Any output structure: this script generates a simple markdown tree. Nothing proprietary, no vendor-lockin. It can be generated from GitHub Actions and put into a Jekyll pages site just as easily as it is run from a Raspberry Pi and used to render the contents of an Ember application.

This would make things as simple as programatically looping over the repos and importing the markdown files.
Programming it right would allow complete freedom in how this is implemented in the repo.
- Check the README.md section headers. Import contents until the next header of the equivalent
- Otherwise, traverse the git repo for **/*.md, repeating the import from above on every file
All you have to do is simply name your headers and/or files after the divio sections (`tutorial`, `how-to`, `explanation`, `reference`). (Oh, don't worry, the search is done through a case insensitive regex. Add more words as you please)

## Getting-Started / tutorial
- Clone the repository using `git clone https://github.com/Denperidge-Redpencil/divio-docs-gen.git && cd divio-docs-gen`
- Install the pre-requirements using `python3 -m pip install -r requirements.txt`
- Setup the .env file (also see the [.env.example](.env.example) file)
| name | value |
| --------- | ------------------------- |
| repos | a list of repositories you want to generate docs for, split by `,`. Format: `owner/reponame`, `owner/reponame@branch` or (when userOrOrg is defined) `reponame`/`reponame@branch` |
| userOrOrg | username or organisation name. Setting this allows you to omit the owner whilst defining repos |
- And finally, run using `python3 app/index.py`!


## Reference
If you want to know more about the design principles of this project, feel free to check out my writeup [here](https://github.com/Denperidge-Redpencil/Learning.md/blob/main/Notes/docs.md#design-principles)!

0 comments on commit f900dd8

Please sign in to comment.