Coder Social home page Coder Social logo

mmanela / docfx-toc-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from systemgroupnet/docfx-toc-generator

0.0 2.0 0.0 18 KB

๐Ÿ“„ A PowerShell module for generating toc.yaml file for DocFX, with Ordering support

Home Page: https://www.powershellgallery.com/packages/docfx-toc-generator/1.0

License: MIT License

PowerShell 100.00%

docfx-toc-generator's Introduction

DocFX TOC Generator

PowerShell Gallery

What is this?

This script is used to generate toc.yml file for every folder in documentation project.

Prerequesties

First you should install powershell-yaml

Install-Module powershell-yaml

Installing Module

โš  THIS MODULE DOES NOT WORK WITH WINDOWS POWERSHELL

โš  MAKE SURE YOU HAVE POWERSHELL CORE INSTALLED.

Install-Module -Name docfx-toc-generator    

FAQ

How to use this module?

Install the module, then run Build-TocHereRecursive function in the root of the docfx project, besides docfx.json

What is the limitation?

This module doesn't generate the root TOC (root of folder besides docfx.json), you should create that file yourself.

What if I want to ignore a folder?

Simply create an empty .nodoc file in the root of the folder.

How to give markdown files name, href, items and order?

The href and items property of item in yaml file is created automatically. For naming and order use Front Matter style yaml meta data in markdown file:

---
name: Sample Page
order: 100 # higher has more priority
---

# Sample Page

How to create hierarchy?

This module puts every non-index file(non-index.md) in the toc, then it includes every index.md files in subfolder in the toc, and other files in subfolders in the items subchild of index file. For example if you have such hierarchy:

|-- root-doc.md
|-- some-other-root-doc.md
>-- MyTopic
  |---- somefile.md
  |---- index.md
|
>-- OtherTopic
  |-- index.md
  |-- hello.md

This toc will be generated:

- name: Root Doc
  href: root-doc.md
- name: Some Other Root Doc
  href: some-other-root-doc.md
- name: My Topic
  href: MyTopic/index.md
  items:
    - name: Some File
      href: MyTopic/somefile.md
- name: Other Topic
  href: OtherTopic/index.md
  items:
    - name: Hello World!
      href: OtherTopic/hello.md

If you want to ignore content of an index and remove its href attribute from toc file, simply add nocontent: true to the front matter:

Table of Front-Matter Tags

Attribute Description Type
name Gives document a name in toc string
order Gives order of rendering to the document in toc (higher number has more priority and comes top of others) int
nocontent Ignores content and remove the href attribute in toc boolean

docfx-toc-generator's People

Contributors

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