From b52c261a89d8d02bc212206321205af21c423777 Mon Sep 17 00:00:00 2001 From: callin Date: Wed, 7 Nov 2018 11:53:07 +0900 Subject: [PATCH 1/2] - change markdown parser from marked to markdown-it - use plantuml plugin. between `@startuml` and `@enduml` text will gnenerate uml image --- README | 1 - docco.js | 82 ++++++++++++-------------- docco.litcoffee | 68 ++++++++++----------- index.html | 154 +++++++++++++++++++++++------------------------- package.json | 39 +++++++----- 5 files changed, 169 insertions(+), 175 deletions(-) diff --git a/README b/README index c1a5e030..7ef0c55a 100644 --- a/README +++ b/README @@ -28,4 +28,3 @@ Usage: docco [options] FILES -t, --template [file] use a custom .jst template -e, --extension [ext] use the given file extension for all inputs -L, --languages [file] use a custom languages.json - -m, --marked [file] use custom marked options diff --git a/docco.js b/docco.js index b0ee5060..29a5978d 100644 --- a/docco.js +++ b/docco.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 2.1.0 +// Generated by CoffeeScript 2.3.2 (function() { // Docco // ===== @@ -27,7 +27,7 @@ // doesn't handle your favorite yet, feel free to // [add it to the list](https://github.com/jashkenas/docco/blob/master/resources/languages.json). // Finally, the ["literate" style](http://coffeescript.org/#literate) of *any* - // language listed in [languages.json](https://github.com/jashkenas/docco/blob/master/resources/languages.json) + // language listed in [languages.json](https://github.com/jashkenas/docco/blob/master/resources/languages.json) // is also supported — just tack an `.md` extension on the end: // `.coffee.md`, `.py.md`, and so on. @@ -77,7 +77,7 @@ // assets, reading all the source files in, splitting them up into prose+code // sections, highlighting each file in the appropriate language, and printing them // out in an HTML template. - var Docco, _, buildMatchers, commander, configure, defaults, document, format, fs, getLanguage, highlightjs, languages, marked, parse, path, run, version, write; + var Docco, MarkdownIt, _, buildMatchers, commander, configure, defaults, document, format, fs, getLanguage, hljs, languages, md, parse, path, run, version, write; document = function(options = {}, callback) { var config; @@ -175,39 +175,27 @@ // To **format** and highlight the now-parsed sections of code, we use **Highlight.js** // over stdio, and run the text of their corresponding comments through - // **Markdown**, using [Marked](https://github.com/chjj/marked). + // **Markdown**, using [markdown-it](https://github.com/markdown-it/markdown-it). format = function(source, sections, config) { - var code, i, j, language, len, markedOptions, results, section; + var code, i, j, language, len, results, section; language = getLanguage(source, config); - // Pass any user defined options to Marked if specified via command line option - markedOptions = { - smartypants: true - }; - if (config.marked) { - markedOptions = config.marked; - } - marked.setOptions(markedOptions); - // Tell Marked how to highlight code blocks within comments, treating that code - // as either the language specified in the code block or the language of the file - // if not specified. - marked.setOptions({ - highlight: function(code, lang) { - lang || (lang = language.name); - if (highlightjs.getLanguage(lang)) { - return highlightjs.highlight(lang, code).value; - } else { - console.warn(`docco: couldn't highlight code block with unknown language '${lang}' in ${source}`); - return code; - } - } - }); + console.log('language', language); +// Tell Marked how to highlight code blocks within comments, treating that code +// as either the language specified in the code block or the language of the file +// if not specified. + +// ```uml +// @startuml +// a -> b +// @enduml +// ``` results = []; for (i = j = 0, len = sections.length; j < len; i = ++j) { section = sections[i]; - code = highlightjs.highlight(language.name, section.codeText).value; + code = hljs.highlight(language.name, section.codeText).value; code = code.replace(/\s+$/, ''); section.codeHtml = `
${code}
`; - results.push(section.docsHtml = marked(section.docsText)); + results.push(section.docsHtml = md.render(section.docsText)); } return results; }; @@ -216,7 +204,7 @@ // documentation file by passing the completed HTML sections into the template, // and rendering it to the specified output path. write = function(source, sections, config) { - var css, destination, first, firstSection, hasTitle, html, relative, title; + var css, destination, html, relative, title; destination = function(file) { return path.join(config.output, path.dirname(file), path.basename(file, path.extname(file)) + '.html'); }; @@ -226,22 +214,14 @@ from = path.dirname(path.resolve(destination(source))); return path.join(path.relative(from, to), path.basename(file)); }; - // The **title** of the file is either the first heading in the prose, or the - // name of the source file. - firstSection = _.find(sections, function(section) { - return section.docsText.length > 0; - }); - if (firstSection) { - first = marked.lexer(firstSection.docsText)[0]; - } - hasTitle = first && first.type === 'heading' && first.depth === 1; - title = hasTitle ? first.text : path.basename(source); + // The **title** of the file is the name of the source file. + title = path.basename(source); css = relative(path.join(config.output, path.basename(config.css))); html = config.template({ sources: config.sources, css, title, - hasTitle, + hasTitle: true, sections, path, destination, @@ -315,11 +295,25 @@ path = require('path'); - marked = require('marked'); + MarkdownIt = require('markdown-it'); commander = require('commander'); - highlightjs = require('highlight.js'); + hljs = require('highlight.js'); + + md = MarkdownIt({ + highlight: (str, lang) => { + var __; + if (lang && hljs.getLanguage(lang)) { + try { + return hljs.highlight(lang, str).value; + } catch (error1) { + __ = error1; + } + } + return ''; + } + }).use(require('markdown-it-plantuml')); // Languages are stored in JSON in the file `resources/languages.json`. // Each item maps the file extension to the name of the language and the @@ -370,7 +364,7 @@ run = function(args = process.argv) { var c; c = defaults; - commander.version(version).usage('[options] files').option('-L, --languages [file]', 'use a custom languages.json', _.compose(JSON.parse, fs.readFileSync)).option('-l, --layout [name]', 'choose a layout (parallel, linear or classic)', c.layout).option('-o, --output [path]', 'output to a given folder', c.output).option('-c, --css [file]', 'use a custom css file', c.css).option('-t, --template [file]', 'use a custom .jst template', c.template).option('-e, --extension [ext]', 'assume a file extension for all inputs', c.extension).option('-m, --marked [file]', 'use custom marked options', c.marked).parse(args).name = "docco"; + commander.version(version).usage('[options] files').option('-L, --languages [file]', 'use a custom languages.json', _.compose(JSON.parse, fs.readFileSync)).option('-l, --layout [name]', 'choose a layout (parallel, linear or classic)', c.layout).option('-o, --output [path]', 'output to a given folder', c.output).option('-c, --css [file]', 'use a custom css file', c.css).option('-t, --template [file]', 'use a custom .jst template', c.template).option('-e, --extension [ext]', 'assume a file extension for all inputs', c.extension).parse(args).name = "docco"; if (commander.args.length) { return document(commander); } else { diff --git a/docco.litcoffee b/docco.litcoffee index d0344be6..d0e3c0e7 100644 --- a/docco.litcoffee +++ b/docco.litcoffee @@ -25,7 +25,7 @@ Docco can be used to process code written in any programming language. If it doesn't handle your favorite yet, feel free to [add it to the list](https://github.com/jashkenas/docco/blob/master/resources/languages.json). Finally, the ["literate" style](http://coffeescript.org/#literate) of *any* -language listed in [languages.json](https://github.com/jashkenas/docco/blob/master/resources/languages.json) +language listed in [languages.json](https://github.com/jashkenas/docco/blob/master/resources/languages.json) is also supported — just tack an `.md` extension on the end: `.coffee.md`, `.py.md`, and so on. @@ -153,48 +153,37 @@ normal below. To **format** and highlight the now-parsed sections of code, we use **Highlight.js** over stdio, and run the text of their corresponding comments through -**Markdown**, using [Marked](https://github.com/chjj/marked). +**Markdown**, using [markdown-it](https://github.com/markdown-it/markdown-it). format = (source, sections, config) -> language = getLanguage source, config - -Pass any user defined options to Marked if specified via command line option - - markedOptions = - smartypants: true - - if config.marked - markedOptions = config.marked - - marked.setOptions markedOptions + console.log('language', language) Tell Marked how to highlight code blocks within comments, treating that code as either the language specified in the code block or the language of the file if not specified. - marked.setOptions { - highlight: (code, lang) -> - lang or= language.name +```uml +@startuml +a -> b +@enduml +``` - if highlightjs.getLanguage(lang) - highlightjs.highlight(lang, code).value - else - console.warn "docco: couldn't highlight code block with unknown language '#{lang}' in #{source}" - code - } +@startuml +a -> b +@enduml for section, i in sections - code = highlightjs.highlight(language.name, section.codeText).value + code = hljs.highlight(language.name, section.codeText).value code = code.replace(/\s+$/, '') section.codeHtml = "
#{code}
" - section.docsHtml = marked(section.docsText) + section.docsHtml = md.render(section.docsText) Once all of the code has finished highlighting, we can **write** the resulting documentation file by passing the completed HTML sections into the template, and rendering it to the specified output path. write = (source, sections, config) -> - destination = (file) -> path.join(config.output, path.dirname(file), path.basename(file, path.extname(file)) + '.html') @@ -203,18 +192,14 @@ and rendering it to the specified output path. from = path.dirname(path.resolve(destination(source))) path.join(path.relative(from, to), path.basename(file)) -The **title** of the file is either the first heading in the prose, or the -name of the source file. +The **title** of the file is the name of the source file. - firstSection = _.find sections, (section) -> - section.docsText.length > 0 - first = marked.lexer(firstSection.docsText)[0] if firstSection - hasTitle = first and first.type is 'heading' and first.depth is 1 - title = if hasTitle then first.text else path.basename source + title = path.basename source css = relative path.join(config.output, path.basename(config.css)) - html = config.template {sources: config.sources, css, - title, hasTitle, sections, path, destination, relative} + html = config.template { + sources: config.sources, css, title, hasTitle:true , sections, path, destination, relative + } console.log "docco: #{source} -> #{destination source}" fs.outputFileSync destination(source), html @@ -280,9 +265,19 @@ Require our external dependencies. _ = require 'underscore' fs = require 'fs-extra' path = require 'path' - marked = require 'marked' + MarkdownIt = require 'markdown-it' commander = require 'commander' - highlightjs = require 'highlight.js' + hljs = require 'highlight.js' + + md = MarkdownIt({ + highlight: (str, lang) => + if lang && hljs.getLanguage(lang) + try + return hljs.highlight(lang, str).value + catch __ + + return ''; + }).use(require('markdown-it-plantuml')) Languages are stored in JSON in the file `resources/languages.json`. Each item maps the file extension to the name of the language and the @@ -339,7 +334,6 @@ Parse options using [Commander](https://github.com/visionmedia/commander.js). .option('-c, --css [file]', 'use a custom css file', c.css) .option('-t, --template [file]', 'use a custom .jst template', c.template) .option('-e, --extension [ext]', 'assume a file extension for all inputs', c.extension) - .option('-m, --marked [file]', 'use custom marked options', c.marked) .parse(args) .name = "docco" if commander.args.length @@ -351,4 +345,4 @@ Parse options using [Commander](https://github.com/visionmedia/commander.js). Public API ---------- - Docco = module.exports = {run, document, parse, format, version} + Docco = module.exports = {run, document, parse, format, version} \ No newline at end of file diff --git a/index.html b/index.html index e8b307ae..e23fd972 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - Docco + docco.litcoffee @@ -14,7 +14,7 @@
-

Docco

+

Docco

@@ -33,66 +33,77 @@

Docco

This page is the result of running Docco against its own source file.

    -
  1. Install Docco with npm: sudo npm install -g docco

    +
  2. +

    Install Docco with npm: sudo npm install -g docco

  3. -
  4. Run it against your code: docco src/*.coffee

    +
  5. +

    Run it against your code: docco src/*.coffee

-

There is no “Step 3”. This will generate an HTML page for each of the named +

There is no "Step 3". This will generate an HTML page for each of the named source files, with a menu linking to the other pages, saving the whole mess into a docs folder (configurable).

The Docco source is available on GitHub, and is released under the Lil License.

Docco can be used to process code written in any programming language. If it -doesn’t handle your favorite yet, feel free to +doesn't handle your favorite yet, feel free to add it to the list. -Finally, the “literate” style of any -language listed in languages.json +Finally, the "literate" style of any +language listed in languages.json is also supported — just tack an .md extension on the end: .coffee.md, .py.md, and so on.

-

Partners in Crime:

+

Partners in Crime:

-

Note that not all ports will support all Docco features … yet.

-

Main Documentation Generation Functions

+

Note that not all ports will support all Docco features ... yet.

+

Main Documentation Generation Functions

@@ -186,48 +197,29 @@

Main Documentation Generation F

To format and highlight the now-parsed sections of code, we use Highlight.js over stdio, and run the text of their corresponding comments through -Markdown, using Marked.

+Markdown, using markdown-it.

format = (source, sections, config) ->
-  language = getLanguage source, config
- - - -

Pass any user defined options to Marked if specified via command line option

- - -
  markedOptions =
-    smartypants: true
-
-  if config.marked
-    markedOptions = config.marked
-
-  marked.setOptions markedOptions
+ language = getLanguage source, config + console.log('language', language)

Tell Marked how to highlight code blocks within comments, treating that code as either the language specified in the code block or the language of the file if not specified.

+
@startuml
+a -> b
+@enduml
+
-
  marked.setOptions {
-    highlight: (code, lang) ->
-      lang or= language.name
-
-      if highlightjs.getLanguage(lang)
-        highlightjs.highlight(lang, code).value
-      else
-        console.warn "docco: couldn't highlight code block with unknown language '#{lang}' in #{source}"
-        code
-  }
-
-  for section, i in sections
-    code = highlightjs.highlight(language.name, section.codeText).value
+          
  for section, i in sections
+    code = hljs.highlight(language.name, section.codeText).value
     code = code.replace(/\s+$/, '')
     section.codeHtml = "<div class='highlight'><pre>#{code}</pre></div>"
-    section.docsHtml = marked(section.docsText)
+ section.docsHtml = md.render(section.docsText)
@@ -237,8 +229,7 @@

Main Documentation Generation F
write = (source, sections, config) ->
-
-  destination = (file) ->
+  destination = (file) ->
     path.join(config.output, path.dirname(file), path.basename(file, path.extname(file)) + '.html')
 
   relative = (file) ->
@@ -248,26 +239,22 @@ 

Main Documentation Generation F -

The title of the file is either the first heading in the prose, or the -name of the source file.

+

The title of the file is the name of the source file.

-
  firstSection = _.find sections, (section) ->
-    section.docsText.length > 0
-  first = marked.lexer(firstSection.docsText)[0] if firstSection
-  hasTitle = first and first.type is 'heading' and first.depth is 1
-  title = if hasTitle then first.text else path.basename source
+          
  title = path.basename source
   css = relative path.join(config.output, path.basename(config.css))
 
-  html = config.template {sources: config.sources, css,
-    title, hasTitle, sections, path, destination, relative}
+  html = config.template {
+    sources: config.sources, css, title, hasTitle:true , sections, path, destination, relative
+  }
 
   console.log "docco: #{source} -> #{destination source}"
   fs.outputFileSync destination(source), html
-

Configuration

+

Configuration

@@ -329,7 +316,7 @@

Configuration

-

Helpers & Initial Setup

+

Helpers & Initial Setup

@@ -340,9 +327,19 @@

Helpers & Initial Setup

_           = require 'underscore'
 fs          = require 'fs-extra'
 path        = require 'path'
-marked      = require 'marked'
+MarkdownIt  = require 'markdown-it'
 commander   = require 'commander'
-highlightjs = require 'highlight.js'
+hljs = require 'highlight.js' + +md = MarkdownIt({ + highlight: (str, lang) => + if lang && hljs.getLanguage(lang) + try + return hljs.highlight(lang, str).value + catch __ + + return ''; +}).use(require('markdown-it-plantuml'))
@@ -371,7 +368,7 @@

Helpers & Initial Setup

-

Ignore hashbangs and interpolations…

+

Ignore hashbangs and interpolations...

    l.commentFilter = /(^#![/]|^\s*#\{)/
@@ -380,8 +377,8 @@ 

Helpers & Initial Setup

-

A function to get the current language we’re documenting, based on the -file extension. Detect and tag “literate” .ext.md variants.

+

A function to get the current language we're documenting, based on the +file extension. Detect and tag "literate" .ext.md variants.

getLanguage = (source, config) ->
@@ -402,12 +399,12 @@ 

Helpers & Initial Setup

-

Command Line Interface

+

Command Line Interface

-

Finally, let’s define the interface to run Docco from the command line. +

Finally, let's define the interface to run Docco from the command line. Parse options using Commander.

@@ -421,7 +418,6 @@

Command Line Interface

.option('-c, --css [file]', 'use a custom css file', c.css) .option('-t, --template [file]', 'use a custom .jst template', c.template) .option('-e, --extension [ext]', 'assume a file extension for all inputs', c.extension) - .option('-m, --marked [file]', 'use custom marked options', c.marked) .parse(args) .name = "docco" if commander.args.length @@ -431,7 +427,7 @@

Command Line Interface

-

Public API

+

Public API

diff --git a/package.json b/package.json index b2f2a335..cffeca67 100644 --- a/package.json +++ b/package.json @@ -1,26 +1,37 @@ { - "name": "docco", - "description": "The Quick and Dirty Literate Programming Documentation Generator", - "keywords": ["documentation", "docs", "generator", "literate", "coffeescript"], - "author": "Jeremy Ashkenas", - "version": "0.8.0", - "license": "MIT", + "name": "docco", + "description": "The Quick and Dirty Literate Programming Documentation Generator", + "keywords": [ + "documentation", + "docs", + "generator", + "literate", + "coffeescript" + ], + "author": "Jeremy Ashkenas", + "version": "0.8.0", + "license": "MIT", "repository": { "type": "git", "url": "https://github.com/jashkenas/docco.git" }, "engines": { - "node": ">=0.2.0" + "node": ">=0.2.0" }, "dependencies": { - "commander": ">= 0.5.2", - "marked": ">= 0.2.7", - "fs-extra": ">= 0.6.0", - "underscore": ">= 1.0.0", - "highlight.js": ">= 8.0.x" + "commander": ">= 0.5.2", + "fs-extra": ">= 0.6.0", + "highlight.js": ">= 8.0.x", + "markdown-it": "^8.4.2", + "markdown-it-plantuml": "^1.3.0", + "marked": ">= 0.2.7", + "underscore": ">= 1.0.0" }, - "main" : "./docco", + "main": "./docco", "bin": { - "docco": "./bin/docco" + "docco": "./bin/docco" + }, + "devDependencies": { + "coffeescript": "^2.3.2" } } From 9f0ff2b699fe105be8354009eaf068c011cb2036 Mon Sep 17 00:00:00 2001 From: callin Date: Sat, 10 Nov 2018 12:55:46 +0900 Subject: [PATCH 2/2] - add mathjax support -- work on linear layout only --- Cakefile | 2 +- docco.js | 26 +++++++++++++++------ docco.litcoffee | 46 +++++++++++++++++++++++++++++--------- index.html | 37 +++++++++++++++++++++++++----- package.json | 1 + resources/linear/docco.css | 30 ++++++++++++++++++++++--- resources/linear/docco.jst | 3 +++ 7 files changed, 118 insertions(+), 27 deletions(-) diff --git a/Cakefile b/Cakefile index e451132c..240c2406 100644 --- a/Cakefile +++ b/Cakefile @@ -16,7 +16,7 @@ task 'install', 'install the `docco` command into /usr/local (or --prefix)', (op lib = base + '/lib/docco' exec([ 'mkdir -p ' + lib + ' ' + base + '/bin' - 'cp -rf bin README resources ' + lib + 'cp -rf bin README resources docco.js node_modules ' + lib 'ln -sf ' + lib + '/bin/docco ' + base + '/bin/docco' ].join(' && '), (err, stdout, stderr) -> if err then console.error stderr diff --git a/docco.js b/docco.js index 29a5978d..23746df8 100644 --- a/docco.js +++ b/docco.js @@ -183,12 +183,6 @@ // Tell Marked how to highlight code blocks within comments, treating that code // as either the language specified in the code block or the language of the file // if not specified. - -// ```uml -// @startuml -// a -> b -// @enduml -// ``` results = []; for (i = j = 0, len = sections.length; j < len; i = ++j) { section = sections[i]; @@ -304,6 +298,7 @@ md = MarkdownIt({ highlight: (str, lang) => { var __; + console.log('lang', lang); if (lang && hljs.getLanguage(lang)) { try { return hljs.highlight(lang, str).value; @@ -313,7 +308,24 @@ } return ''; } - }).use(require('markdown-it-plantuml')); + // uml support + // ```puml + // @startuml + // a -> b + // @enduml + // ``` + + // @startuml + // a -> b + // @enduml + }).use(require('markdown-it-plantuml'), { + imageFormat: 'png' + // math support + }).use(require('markdown-it-mathjax')()); + + // \begin{equation} + // E = mc^2 + // \end{equation} // Languages are stored in JSON in the file `resources/languages.json`. // Each item maps the file extension to the name of the language and the diff --git a/docco.litcoffee b/docco.litcoffee index d0e3c0e7..3a96890e 100644 --- a/docco.litcoffee +++ b/docco.litcoffee @@ -163,16 +163,6 @@ Tell Marked how to highlight code blocks within comments, treating that code as either the language specified in the code block or the language of the file if not specified. -```uml -@startuml -a -> b -@enduml -``` - -@startuml -a -> b -@enduml - for section, i in sections code = hljs.highlight(language.name, section.codeText).value code = code.replace(/\s+$/, '') @@ -271,13 +261,47 @@ Require our external dependencies. md = MarkdownIt({ highlight: (str, lang) => + console.log 'lang', lang + if lang && hljs.getLanguage(lang) try return hljs.highlight(lang, str).value catch __ return ''; - }).use(require('markdown-it-plantuml')) + }) + +uml support +```puml +@startuml +a -> b +@enduml +``` + +@startuml +a -> b +@enduml + + .use(require('markdown-it-plantuml'),{imageFormat:'png'}) + +math support +``` +\begin{equation} +e^{\pi i} + 1 = 0 +\end{equation} +``` + +\begin{equation} +e^{\pi i} + 1 = 0 +\end{equation} + + + .use(require('markdown-it-mathjax')()) + + + + + Languages are stored in JSON in the file `resources/languages.json`. Each item maps the file extension to the name of the language and the diff --git a/index.html b/index.html index e23fd972..265625d6 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,9 @@ +
@@ -209,10 +212,6 @@

Main Documentation Generation Functions

Tell Marked how to highlight code blocks within comments, treating that code as either the language specified in the code block or the language of the file if not specified.

-
@startuml
-a -> b
-@enduml
-
  for section, i in sections
@@ -333,13 +332,41 @@ 

Helpers & Initial Setup

md = MarkdownIt({ highlight: (str, lang) => + console.log 'lang', lang + if lang && hljs.getLanguage(lang) try return hljs.highlight(lang, str).value catch __ return ''; -}).use(require('markdown-it-plantuml'))
+})
+ + + +

uml support

+
@startuml
+a -> b
+@enduml
+
+uml diagram + + +
.use(require('markdown-it-plantuml'),{imageFormat:'png'})
+ + + +

math support

+
\begin{equation}
+e^{\pi i} + 1 = 0
+\end{equation}
+
+

\begin{equation} +e^{\pi i} + 1 = 0 +\end{equation}

+ + +
.use(require('markdown-it-mathjax')())
diff --git a/package.json b/package.json index cffeca67..338b9e35 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "fs-extra": ">= 0.6.0", "highlight.js": ">= 8.0.x", "markdown-it": "^8.4.2", + "markdown-it-mathjax": "^2.0.0", "markdown-it-plantuml": "^1.3.0", "marked": ">= 0.2.7", "underscore": ">= 1.0.0" diff --git a/resources/linear/docco.css b/resources/linear/docco.css index 54ba14e1..a240e074 100644 --- a/resources/linear/docco.css +++ b/resources/linear/docco.css @@ -113,7 +113,7 @@ pre, tt, code { } .page pre { margin: 0; - width: 608px; + width: 900px; padding: 10px 15px; background: #fcfcfc; -moz-box-shadow: inset 0 0 10px rgba(0,0,0,0.1); @@ -138,14 +138,14 @@ pre, tt, code { /*--------------------- Layout ----------------------------*/ .container { - width: 760px; + width: 1000px; margin: 0 auto; background: #fff; background: rgba(255,255,255, 0.4); overflow: hidden; } .page { - width: 640px; + width: 920px; padding: 30px; margin: 30px; background: #fff; @@ -335,3 +335,27 @@ pre .hljs-chunk { pre .hljs-tex .hljs-formula { opacity: 0.5; } + + +/* +table +*/ + + +table { + display: block; + white-space: nowrap; + overflow-x: auto; + width: 100%; + border-spacing: 0; + border-collapse: collapse; +} + +td, th { + padding: 9px 13px; + border: 1px solid #d8d8d8; +} + +tr:nth-child(2n) td { + background-color: #f4f4f4; +} diff --git a/resources/linear/docco.jst b/resources/linear/docco.jst index ec73e66b..5989699d 100644 --- a/resources/linear/docco.jst +++ b/resources/linear/docco.jst @@ -6,6 +6,9 @@ +