Giter Site home page Giter Site logo

lulzzz / docs-project-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cedar-ave/docs-project-template

0.0 2.0 0.0 725 KB

A Health Catalyst-branded sample Markdown documentation project that generates a website and/or PDFs

CSS 92.09% JavaScript 7.91%

docs-project-template's Introduction

This starter Markdown documentation project supports Health Catalyst teams that want to begin managing their documentation as Markdown files. It uses the open-source tool DocFx to generate a website and PDFs. The output aligns with Health Catalyst's Fabric.Cashmere style guide.

For an example of the web output, Markdown cheatsheets, and details on things like icons, callouts, styles, etc., see docs.healthcatalyst.com.

The following instructions apply to Windows, but DocFx and this project are also supported on Linux and macOS.

Install DocFx

  • Create a folder in C:\Program Files called docfx.
  • Download docfx.zip from the DocFx releases page.
  • Extract the contents to C:\Program Files\docfx.

If you want to generate PDFs

  • Download the wkhtmltopdf installer.
  • Run the installer. Use the default C:\Program Files\wkhtmltopdf as the destination folder.

Add DocFx and wkhtmltopdf to PATH (in Windows)

  • Control Panel > Change View by to Small icons > System > Advanced system settings > Environment Variables...
  • Under the System variables section, scroll to Path. Select it and click Edit....
  • Depending on what version of Windows you're using, you see either a long string of values separated by semicolons or values in a vertical list.
    • If you see a long string of values, append to the end: ;C:\Program Files\DocFX;C:\Program Files\wkhtmltopdf\bin
    • If you see values in a vertical list: Click New and paste C:\Program Files\DocFX. Click New again and paste C:\Program Files\wkhtmltopdf\bin.

Build this project as a website

  • On this project's Github page, click Clone or download > Download ZIP. Extract it to wherever is convenient. This is the directory you'll work in. Don't extract it to C:\Program Files\docfx.
  • Open Windows Command Prompt. Enter cd followed by the filepath to your directory. For example, cd C:\docs-project-template-master.
  • Run docfx build docfx.json --serve.
  • In your browser, go to http://localhost:8080.

For an easy internal website

Generate PDFs

  • Run docfx pdf in Windows Command Prompt.
  • The PDFs are in the newly generated subdirectory _site_pdf\docs-project-template-master_pdf in your directory.

How to change the order of articles

  • The toc.yml file in articles determines the tabs in the menu bar of the site.
  • The toc.yml files in articles/<guide> determine the order of articles in the site.
  • The toc.yml files in pdf/<guide> determine the order of articles in the PDF.

If you want to use Font Awesome icons

Font Awesome is the icon font used in Catalyst apps.

  • Install Node.js.
  • Close and reopen Windows Command Prompt. Enter cd followed by the filepath to your directory. For example, cd C:\docs-project-template-master.
  • Enter npm install --save.
  • How to include an icon in a Markdown file: <i class="fa fa-plus"></i> (in this example, replace fa-plus with fa-name-of-icon found in this cheatsheet)

Other sample DocFx documentation projects

Starter project

  • Create a directory for your project.
  • Inside that directory, open Windows Command Prompt.
  • Run docfx init -q.

Sample project

Walkthroughs

See DocFx walkthroughs.

Complication with the PDF title pages

The table of contents is always page 1. If you want a title page, create the title page as page 2 and use this script to flip the them.

  • Install PDFtk Free. On the final window of the installer, choose not to open the program.
  • Install Windows Git. This installs the Git Bash command-line tool, which allows you to run the Bash script that flips the pages.
  • Open Git Bash and cd to your directory of generated PDFs. In Bash, use forward slashes in the directory path instead of back slashes (for example, cd C:/docs-project-template-master/_site_pdf/docs-project-template-master_pdf).
  • Copy the following block of code. Right-click in Git Bash and select paste.
for filename in *.pdf; do
pdftk "$filename" cat 2-1 3-end output "$(date +%F)_$filename"
done
  • Each new PDF's filename is prepended with today's date.
  • Before you run docfx pdf again, delete the existing PDF(s).

Credits

The site template is based on https://github.com/MathewSachin/docfx-tmpl.

docs-project-template's People

Contributors

cedar-ave avatar

Watchers

 avatar  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.