Giter Site home page Giter Site logo

docs-1's Introduction

Quick Start - run mkdocs in a container with python2

git clone [email protected]:sematext/docs.git
cd docs
docker run -d --name st-mkdocs -p 8000:8000 -v $(pwd):/workspace pengbai/docker-mkdocs \
pip install mkdocs-material===2.7.0 &&  \
pip install markdown-fenced-code-tabs && mkdocs serve 
open http://localhost:8000

Build site with Docker

Run the build.sh script. It will create a site folder that you can deploy.

$ ./build.sh

Manual installation

Install python & pip - see Manual Installation

$ python --version
Python 2.7.2
$ pip --version
pip 1.5.2

Install requirements:

pip install -r requirements.txt

In mkdocs.yml:

Getting started Start the server by running the mkdocs serve command:

$ mkdocs serve
INFO    -  Building documentation...
INFO    -  Cleaning site directory
[I 160402 15:50:43 server:271] Serving on http://127.0.0.1:8000
[I 160402 15:50:43 handlers:58] Start watching changes
[I 160402 15:50:43 handlers:60] Start detecting changes

Open up http://127.0.0.1:8000/ in your browser, and you'll see the default home page being displayed:

Build the site

$ mkdocs build

This will create a new directory, named site. Now, we can deploy site to server.

Generate PDF

We also use pandoc to convert markdown to PDF.

  • goto the markdown folder: we need to convert to PDF fromt he folder which contains the markdown file so that pandoc can read image file.
  • generate all markdown to PDF and store in folder ./pdf
  PROJECT_FOLDER/bin/to_pdf 

Run link checker

Check 404 links for sematext.com/docs using w3c linkchecker https://validator.w3.org/checklink?uri=http%3A%2F%2Fsematext.com%2Fdocs&hide_type=dir&recursive=on&depth=&check=Check

Convert Confluence to Markdown

Export Confluence to HTML

Use Confluence export feature to export HTML. It can export the whole space or individual page. Here are steps:

  • go to Space tools
  • go to Content Tools tab
  • go to Export tab
  • choose HTML option
  • choose Normal Export option to extract the whole space and Custom Export if you want to extract individual page
  • click Export

Extract main content from HTML

The exported HTML from the previous step contains layout format from Confluence. Extract only the main content from it before converting to Markdown.

Extract the export zip file to folder

unzip Confluence-space-export-XXX.zip

Then extract main content to another folder

java -jar bin/extract.jar inputDir ouputDir
   - inputDir the extracted space folder Or a html file
   - outputDir the output folder

Convert to Markdown

Use pandoc to convert HTML to Markdown. Install pandoc using instructions from https://pandoc.org/installing.html

Convert the HTML extracted in the previous step to Markdown

bin/to_md.sh inputDir outputDir
   - inputDir: the extracted html folder
   - outputDir: the markdown folder

Convert Google Doc to Markdown

  1. In your google doc go to Tools > Script editor
  2. Copy this script to the code section in the Script editor
  3. Save the script
  4. To trigger the conversion (from Script editor) go to Run > Run function > ConvertToMarkdown (it will run on the google doc from which you opened Script editor)
  5. You'll be prompted to give GDrive reading and mailing rights to the script
  6. You'll receive an email with markdown and image files attached

docs-1's People

Contributors

otisg avatar megastef avatar adnanrahic avatar fulyauluturk avatar gr0 avatar cpipilas avatar nmtien avatar rabbitstack avatar radu-gheorghe avatar michaelhigham avatar bsmid avatar hssalman avatar amir-hadzic avatar lujomon avatar pablob94 avatar prog8 avatar mbonaci avatar emir-arnautovic avatar johndemian avatar sivasamyk avatar mashinista avatar emhus avatar hollerloudly avatar boratanrikulu avatar alterebro avatar hasan-wajahat avatar komljen avatar gorkemmeydan avatar amirmuminovic avatar yago-123 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.