Giter VIP home page Giter VIP logo

asciidoc2zendesk's Introduction

asciidoc2zendesk

Asciidoc to zendesk converter & uploader

Library structure

Documents directory structure should conform to following rules:

  1. Library should be two levels deep

    1.1. First level contains a list of categories

    1.2. Second level contains a list of sections

  2. Directory naming does not matter

  3. Each directory should contain .properties file where category or section parameters should be set according to following examples:

  • category-level .properties file
CATEGORY_TITLE=Category 2 title
CATEGORY_OLD_TITLE=... // [optional parameter]
CATEGORY_DESCRIPTION=Category 2 description
CATEGORY_POSITION=1
  • section-level .properties file
SECTION_TITLE=Section 2.2 title
SECTION_OLD_TITLE=... // [optional parameter]
SECTION_DESCRIPTION=Section Section 2.2 description
SECTION_POSITION=1

NOTE: directories with no .properties file or with incorrect .properties syntax will be skipped.

NOTE: if category with CATEGORY_OLD_TITLE exists, it will be renamed to CATEGORY_TITLE

NOTE: if section with SECTION_OLD_TITLE exists, it will be renamed to SECTION_TITLE

Publishing to Zendesk

To publish a document to zendesk server its meta-parameters should be known. Parser takes these parameters from comments in input file:

// :ZENDESK-TITLE:      <text>               // article title [mandatory header]
// :ZENDESK-ORDER:      <number>             // article sorting position 
// :ZENDESK-DRAFT:      {true|false}         // create article as a draft
// :ZENDESK-PROMOTED:   {true|false}         // set 'promoted' flag for an article    
// :ZENDESK-TAGS:       <CSV list of labels> // comma-separated list of article labels
// :ZENDESK-OLD-TITLE:  <text>               // previous article title to be used for article renaming [optional parameter]
  • If document with ZENDESK-TITLE title already exists, it will be overwritten
  • If document with ZENDESK-OLD-TITLE title exists, it will be renamed to ZENDESK-TITLE

Also zendesk server credentials should be provisioned to program:

  --url=https://<domain>.zendesk.com --user=<login> --token=<configured-access-token>

Cleaning up stale articles

It can happen that zendesk server will contain articles which are not in repository already (so-called 'stale' articles). You can remove them from zendesk server during publication, if you run program with --clean argument.

Converting documents

The data for program should be be provisioned like this:

  • directory (--dir=<directory>)

    Directory will be processed recursively. All the *.adoc and *.asciidoc files will be converted (and published to zendesk server). Subdirectories are being processed in such a way that at first all files from a directory are being processed, then (if needed) all the 'stale' articles for given section are being removed and then all the subdirectories are being processed.

Tagging documents

If ZENDESK-TAGS header is set, then article will be marked with these labels on zendesk server. Tags should be separated with commas.

Table Of Contents

To insert TOC macro in resulting document use following syntax:

// ...

= Title
:hardbreaks:
:toc:

{zwsp}

... the rest of document ...

asciidoc2zendesk's People

Contributors

mvkvl avatar

Stargazers

 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.