Skip to content

aside-ufba/guide-automator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GuideAutomator

npm version Node Version Needed

Automated User Guide Generation with Markdown


Installation


  • On Linux

    • (Option 1)You can install with script

      sudo wget -qO- https://raw.githubusercontent.com/welbert/guide-automator/master/install_linux.sh | bash -
    • (Option 2) Manual installation. You need install some binary dependencies.

      1.Node and npm:

        https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
      

      2.ImageMagick (Usually is already installed):

        https://www.imagemagick.org/script/binary-releases.php#unix
      

      3.Wkhtmltopdf

        http://wkhtmltopdf.org/downloads.html
      

      4.Chrome/Chromium Browser

      -Chrome:
        https://www.google.com/chrome/browser/desktop/index.html
      -Chromium:
        sudo apt-get install chromium-browser
      

      5.Chrome WebDriver

        https://chromedriver.storage.googleapis.com/index.html?path=2.25/
      

      6.Guide-Automator

        sudo npm install -g guide-automator
      

    Node, wkhtmltopdf and Chrome WebDriver need to be add in path.

  • On Windows

    1.Node and npm:

      https://nodejs.org/en/download/
    

    2.ImageMagick:

      https://www.imagemagick.org/script/binary-releases.php#windows
    

    3.Wkhtmltopdf

      http://wkhtmltopdf.org/downloads.html
    

    4.Chrome

    -Chrome:
      https://www.google.com/chrome/browser/desktop/index.html
    

    5.Chrome WebDriver

      https://chromedriver.storage.googleapis.com/index.html?path=2.25/
    

    6.Guide-Automator

      npm install -g guide-automator
    

    Node, ImageMagick,wkhtmltopdf and Chrome WebDriver need to be add in path.


Getting started


Guide-automator extract javascript tags (```javascript guide-automator commands ```) from markdown file and generate manual from them. You need use our API commands in markdown file.

Example:

# This is my github

```javascript
  get('https://github.com/welbert');
  takeScreenshot();
```(<- three back-ticks)


USAGE


$ node guide-automator.js -h

  Usage: guide-automator [options]

  Options:


    -h, --help             output usage information
    -V, --version          output the version number
    -i, --input <File.md>  Input .md file
    -o, --output <Folder>  Output destination folder
    -P, --pdf              Export manual to PDF, default is export for all types
    -H, --html             Export manual to HTML, default is export for all types
    -I, --image            Export ONLY manual's image and ignore others types, default is export for all types
    -L, --legacy           Use Legacy mode "<automator>" [DEPRECATED]

  Examples:

    $ guide-automator -i input.md -o output/
    $ guide-automator -i input.md

API commands


get

click

  • Params: <cssSelector>
  • Example:
    • click('.unstarred > button:nth-child(2)');

clickByLinkText

  • Params: <linkText>
  • Example:
    • clickByLinkText('README.md');

takeScreenshot

  • Params: [imageWidth]
  • Example:
    • takeScreenshot();
    • takeScreenshot('10%');

takeScreenshotOf

  • Params: <cssSelector>, [crop], [outline], [imageWidth]
  • Example:
    • takeScreenshotOf('#user-content-guideautomator');
    • takeScreenshotOf('#user-content-guideautomator',false,true);

fillIn

  • Params: <cssSelector>, <input>
  • Example:
    • fillIn('.header-search-input','guide-automator');

submit

  • Params: <cssSelector>
  • Example:
    • submit('.js-site-search-form');

wait

  • Params: <cssSelector>, [timeOut]
  • Example:
    • wait('.commit-author-section');
    • wait('.commit-author-section',2000);

sleep

  • Params: <milleseconds>
  • Example:
    • sleep(1000);