Giter VIP home page Giter VIP logo

xdoc's Introduction

xDoc

xDoc will traverse all of GitLab -- groups/subgroups and projects that it has access to and will look in each repository for:

  • a top-level file named .xdoc.yaml that allows for setting some scrape (and other) options.
  • a directory named xdoc (see the -dir option)

It will both render and index these markdown files, the following endpoints are available:

  • /s; exposed the bleve search endpoint.
  • /s/<query>; directly search for <query>.
  • /s/?q=<query<; GET endpoint for the search page, may be hit directly, by /s/<query> might be more convenient.
  • /r/<groupname>/<subgroupname>/<projectname>; hitting this endpoint will render the index.md markdown file.
  • /r/<groupname>/<subgroupname>/<projectname>/<filename>; hitting this endpoint will render the <filename>.md markdown file.
  • /r/<groupname>/<projectname>; hitting this endpoint will render the index.md markdown file.
  • /r/<groupname>/<projectname>/<filename>; hitting this endpoint will render the <filename>.md markdown file.

More endpoints may be added in the future; for instance listing all repositories or things like that.

.xdoc.yaml

This YAML file contains various options, such as the Git ref used to needs to be retrieved, the markdown flavor used for parsing and in which language the pages are written. This file MUST exist in the master branch of the repository.

lang: LANG
ref: GIT-REFERENCE
flavor: mmark|commonmark|gfm|codelab

Trying It

Using the public gitlab.com instance you can run the following:

./xdoc -group miekg -gitlab https://gitlab.com -dir xdoc

Conventions

As markdown is not really expressive rendering a lot of documents in a sane way requires metadata that is not present in the files themselves.

  1. If an index.md file is present it will be rendered. If not found the directory is sorted alphabetically and the first entry is rendered.

Limitations

Re-downloads everything every time. Need to store last commit and retrieve (implement poor man's git).

Using a storage abstraction (+memory caching) would be nice. Right now everything is cached in memory.

TODO

  • Think about references to files in the xdoc directory; we need to find (rewrite target?) somehow - should be done in the markdown renderer or source conventions?
  • Think about references to images, same story as for files?
  • Header/footer and stuff like that.
  • Add codelab support, integrate 'claat' or just use the bits for parsing.

xdoc's People

Contributors

miekg avatar

Watchers

 avatar

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.