personium / legacy-docs

This repository is obsolete. Latest contents are maintained under new-docs. Therefore, please DO NOT open issues, fork or send pull request to this repository.
Apache License 2.0
2 stars 6 forks source link

Add explanation to the project's README the rules for editing #7

Closed dixonsiu closed 7 years ago

dixonsiu commented 7 years ago

Questions to be answer:

  1. Who is responsible for running the Pandoc command?
  2. What template or filter should be running with Pandoc command?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <meta http-equiv="Content-Style-Type" content="text/css" />
      <meta name="generator" content="pandoc" />
      <title></title>
      <style type="text/css">code{white-space: pre;}</style>
      <link rel="stylesheet" href="../github.css" type="text/css" />
    </head>

Plus the following rules:

  1. Edit markdown file (see example) with relative path
  2. Link refer to markdown file can automatically converted to link to HTML file
dixonsiu commented 7 years ago

Basic solution to Q2 is here.
Need to add information on meta/CSS template to Pandoc command.

KourokiTakuto commented 7 years ago

Answer on Q2

The format specifies markdown_github. As mentioned above, the filter creates and specifies convertlink.py at the link destination. CSS specifies github.css with the -c option.

The command satisfying the above is as follows.

Pandoc -s -f markdown_github --filter=convertlink.py xxxx.md - c github.css - o xxxx.html

Although it is converted to an HTML file by the above command, it is necessary to pay attention to the following.

If there is a table to be converted, tags are created automatically as \<table style = "width: 28%;">. If you specify width, the table display will be incorrect, so you need to convert it to \<table>.

dixonsiu commented 7 years ago

Kouroki-san,

Thank you for you input.

~~it seems like the latest Pandoc does not have the table width issue anymore. ~~
I was wrong, certain table in markdown does convert to table width in HTML.

>pandoc --version
pandoc 1.19.2.1

Moreover, if we execute the Pandoc command in Windows, we need to use the "/" correctly when specifying the parameters.
Following is the example when executed in document-writer directory.

pandoc -s -f markdown_github --filter=../../../convertLink.py -c ../github.css README.md -o index.html
dixonsiu commented 7 years ago

Use the following scripts in en/ja:

  1. a convert script that traverse the directory and convert md files
  2. the filter called internally by the above script to convert link inside a markdown file.

Note: Need to be add the body class ("listStyleTypeNone") manually back after converting the markdown for now. Best way is to rewrite the sections that weren't meant for itemization.

dixonsiu commented 7 years ago

Latest command for automation requires the followings.

  1. Write special itemized list in HTML format in markdown file.
    Sample changes that I applied for English version. UL tag uses a special CSS class to hide the "bullet".

    <ul class="listStyleTypeNone">
  2. Unfortunately, table conversion still needs to do it manually.