Giter Club home page Giter Club logo

docuowl's Introduction

πŸ¦‰ 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 People

Contributors

coelhucas avatar heyvito avatar matheusmedeiros avatar ofeefo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docuowl's Issues

Brew installation broken

Hi,
it seems that the brew formula is outdated:

Error: Invalid formula: /usr/local/Homebrew/Library/Taps/docuowl/homebrew-tap/Formula/docuowl.rb
docuowl: Calling bottle :unneeded is disabled! There is no replacement.
Please report this issue to the docuowl/tap tap (not Homebrew/brew or Homebrew/core):
  /usr/local/Homebrew/Library/Taps/docuowl/homebrew-tap/Formula/docuowl.rb:10

Error: Cannot tap docuowl/tap: invalid syntax in tap!

could not be installed on mac with m1 chip

Warning: Calling bottle :unneeded is deprecated! There is no replacement.
**Please report this issue to the docuowl/tap tap (not Homebrew/brew or Homebrew/core):
  /opt/homebrew/Library/Taps/docuowl/homebrew-tap/Formula/docuowl.rb:10**

Error: Invalid formula: /opt/homebrew/Library/Taps/docuowl/homebrew-tap/Formula/docuowl.rb
formulae require at least a URL

Error: Cannot tap docuowl/tap: invalid syntax in tap!

I can not install it, I think it may be an issue with compatibility with the mac m1 apple chip or Monetery OS

And thanks.

Looking for examples

Hi, For me I think this project is amazing!
But its a little vague for me how I should make all the folders and how the md files should be written.

Can anyone send me an example?
or all folders that make up the demo provided by the author?

Thank you

Request to improve installation instructions

Hi! Nice-looking project. I'd love to create more readable documentation with docuowl for some of my projects.

However, I might be daft, but I am not sure on the actual installation process, since this is not covered in any detail.

I am on macOS 11.2.3 (Macbook Pro M1) and using the Darwin ARM64 variant of docuowl. It can be directly executed (i.e. double-clicking the file) after allowing it in Security (being third party software). Adding it to the path variable in .zshrc (as I am assuming the intended installation would be) does not allow me to use it. Executing it with sh docuowl gives an error about being unable to execute a binary file.

This is all probably very easy to get working, but I'd be happy for advice and maybe having this updated in the docs for anyone having these "dumb" problems :)

Suggestion for full-text search (stork)

I just recently discovered stork, and I think it could be a good "3rd party" (self-hosted, not cloud!) solution for full-text search without having to reinvent the wheel inside Docuowl.

As far as I know, stork currently doesn't recursively add files from a directory to its database, but once your Docuowl tree is well established, you could configure stork (or write a script to autogen the config if you have tons of files) and it should work well (although I haven't tested it with Docuowl yet...).

On the Docuowl side, perhaps there could be an integration with stork so that the search bar uses either the built-in search feature or stork's search.

Just a thought!

Make the design responsive

I often scroll documentation on my phone (as to have a third screen) and currently, the mobile view is… somewhat lacking. I attached a screenshot to highlight what I mean. The main text is all squashed up while the examples take way too much space.

My suggestion would be to move the example column under their corresponding text to make it easier to read.
photo5431762281198366932

howto build binary

xiaods@ZBBB2006M-0032:/mnt/e/code/docuowl$ go mod vendor
github.com/heyvito/docuowl/parts imports
        embed: package embed is not in GOROOT (/usr/local/go/src/embed)

Images do not resize in a responsive way

Currently, images do not resize in a responsive way on smaller resolutions/mobile. It's a matter of a few lines of CSS, so I thought it wouldn't be too much of a problem to fix it :^)

Example of what I'm talking about:
image

Code formatting doesn't work for yaml

When using codeblocks for yaml somehow all lines get squished into one, making it unusable. It works if you don't specify a language but that removes the nice syntax highlighting. I haven't encountered this with other languages.

Example:

image

Sidenotes content:

  #! Usage

  ```yml
  actions:
    - id: something
      uses: something/something@v1
      something: else
```

This is not just the case with sidenotes, also if you place it in the content.md file.

Any idea why this is just happening with yaml?

Dark mode switch

Hi @heyvito, nice project! Is there an easy way to use a light color mode instead of the dark mode? On the Stripe API documentation page there is a dark mode switch, would it be possible to have it on the docuowl generated documentation too?

Markdown lists don't work

list:
* foo
* bar

docuowl seems to ignore markdown lists, I get the following result:

list: * foo * bar

Add a visible anchor link

Currently it is not possible to get an anchor link from a title. It would be nice to have something like GitHub's, which shows an anchor button when one hovers a title.

x

Improve argument parsing

Although flags is enough, IMHO urfave/cli can provide a way better UX. We should be able to replace it without breaking compatibility.

Will this work in Windows?

Just wondering. I guess I can try go install...

Update - saw closed issue about Windows - answer is no.

How to add my custom CSS?

Hi, I found this project today and already becoming a big fan, with its simplicity and Stripe-ish looking UI!

So my question, how could I override the existing CSS to tweak some styles?

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.