Code Monkey home page Code Monkey logo

πŸ¦‰ Docuowl

Docuowl generates a static single-page documentation from Markdown files

Rationale

As a long-time fan of documentation style made by Stripe, and Markdown, I decided to use the former as a base to create a pretty documentation generator that outputs something like Stripe's. Stripe also generously allowed me to use their layout, so here's a big thank you to them! β™₯️

Demo

Looking for a demo? A simple demo is available at https://docuowl.github.io/demo/!

Docuowl Screenshot

Installing

Brew

To install Docuowl using Homebrew, execute the following command:

brew install docuowl/tap/docuowl

Manually

Refer to the releases page to get the latest version.

Documentation Organization

Docuowl takes a directory as input. The directory is expected to have one directory for each section or group. Each group may have subsections, which by their turn must also be placed into directories. Each Section is required to have an content.md file, containing the Frontmatter for that section, and an optional sidenotes.md file, that will be rendered to the right of the section. The Frontmatter must contain at least a Title property, and an optional ID property containing a unique slug for that section. Each Group must contain a single meta.md file, containing a Frontmatter like a Section, and an optional content following the frontmatter.

For instance, take the following directory tree as example:

.
β”œβ”€β”€ 1-introduction
β”‚Β Β  └── content.md
β”œβ”€β”€ 2-errors
β”‚Β Β  β”œβ”€β”€ content.md
β”‚Β Β  └── sidenotes.md
β”œβ”€β”€ 3-authentication
β”‚Β Β  β”œβ”€β”€ content.md
β”‚Β Β  └── sidenotes.md
β”œβ”€β”€ 4-authorization
β”‚Β Β  β”œβ”€β”€ 1-login
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ content.md
β”‚Β Β  β”‚Β Β  └── sidenotes.md
β”‚Β Β  β”œβ”€β”€ 2-logout
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ content.md
β”‚Β Β  β”‚Β Β  └── sidenotes.md
β”‚Β Β  β”œβ”€β”€ 4-me
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ content.md
β”‚Β Β  β”‚Β Β  └── sidenotes.md
β”‚Β Β  └── meta.md
β”œβ”€β”€ 5-foo
β”‚Β Β  β”œβ”€β”€ 1-listing-foos
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ content.md
β”‚Β Β  β”‚Β Β  └── sidenotes.md
β”‚Β Β  β”œβ”€β”€ 2-merged-foos
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ content.md
β”‚Β Β  β”‚Β Β  └── sidenotes.md
β”‚Β Β  └── meta.md
β”œβ”€β”€ 6-bars
β”‚Β Β  β”œβ”€β”€ content.md
β”‚Β Β  └── sidenotes.md
β”œβ”€β”€ 7-list-foobars
β”‚Β Β  β”œβ”€β”€ content.md
β”‚Β Β  └── sidenotes.md
β”œβ”€β”€ 8-get-foobar
β”‚Β Β  β”œβ”€β”€ content.md
β”‚Β Β  └── sidenotes.md
└── 9-foobar-data
    β”œβ”€β”€ content.md
    └── sidenotes.md

Example of meta.md:

---
Title: Authorization
---

> :warning: **Warning**: All authorization endpoints are currently in maintenance

Markdown Extensions

Docuowl introduces two new blocks to Markdown: Boxes and Attributes List.

Boxes

Boxes can only be used in sidenotes. To create a new box, use the following format:

#! This is a box
And this is the box's content

After one #!, the box will take any content that follows until one of the following conditions are met:

  1. A horizontal ruler is found (----)
  2. Another Box begins.

Attributes List

Attributes Lists can only be used in contents. To create a new Attribute List, use the following format:

#- Attribute List
- Key1 `type`
- Key1 Description

Usage

Docuowl can be invoked in two modes: Compile, and Watch.

Compile

Compilation will output a single index.html file to an specified directory, taking another directory as input. For instance:

$ docuowl --input docs --output docs-html

Watch

Watch allows one to continuously write documentation and see the preview with auto-reload. For that, use:

$ docuowl --input docs --output docs-html --watch

Docuowl v0.1
Listening on 127.0.0.1:8000

Then open your browser and point to 127.0.0.1:8000. The page will be reloaded each time a file changes in the input directory.

Building

In order to locally build, use the provided Makefile. Steps consist of running cmd/static-generator/main.go, responsible for compiling static files required by static/static.go, and running go build on cmd/docuowl/main.go.

TODO

  • Full-text Search
  • Add tests

License

This software uses other open-source components. For a full list, see the LICENSE file.

MIT License

Copyright Β© 2021 Victor Gama
Copyright Β© 2021 Real Artists

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.

Docuowl's Projects

owl-fts icon owl-fts

πŸ¦‰ Docuowl full-text search parser

owl-wasm icon owl-wasm

πŸ•ΈπŸ¦€ WASM wrapper for owl-fts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.