forked from Denperidge-Redpencil/divio-docs-gen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added LICENSE, updated README & .env.example
- Loading branch information
1 parent
d23ff64
commit f900dd8
Showing
3 changed files
with
45 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)! |