diff --git a/lib/flotFyrTransformer.js b/lib/flotFyrTransformer.js index d90da57..7becb20 100644 --- a/lib/flotFyrTransformer.js +++ b/lib/flotFyrTransformer.js @@ -46,7 +46,7 @@ module.exports = function(src, dest, markdownOptions) { // if its a numbered Files, then remove number if (markdownOptions.numberedFiles) { - filename = filename.split(".")[0]; + filename = filename.split(".")[1]; } return through(function(chunk, enc, done) { @@ -59,10 +59,10 @@ module.exports = function(src, dest, markdownOptions) { }, markdownOptions ); - // const jsx = toComponentModule(output, markdownOptions); - // const beautifulJsx = prettier.format(jsx, prettierOption); + const jsx = toComponentModule(output, markdownOptions); + const beautifulJsx = prettier.format(jsx, prettierOption); - done(null, output); + done(null, beautifulJsx); }); } }; diff --git a/output/1.testmarkdown.js b/output/1.testmarkdown.js index 8e882f8..2299999 100644 --- a/output/1.testmarkdown.js +++ b/output/1.testmarkdown.js @@ -1,114 +1,152 @@ ---- -title: Everything is ok -quantity: 834 -prependJs: - - "const Timer = require('./timer')" - - "import { Watcher } from './watcher'" ---- -# An h1 header - -{{ }} -Paragraphs are separated by a blank line. - -2nd paragraph. *Italic*, **bold**, and `monospace`. Itemized lists -look like: - - * this one - * that one - -> Block quotes are -> written like so. - -## An h2 header - -Here's a numbered list: - - 1. first item - 2. second item - 3. third item - -Note again how the actual text starts at 4 columns in (4 characters -from the left side). Here's a code sample: - - # Let me re-iterate ... - for i in 1 .. 10 { do-something(i) } - -As you probably guessed, indented 4 spaces. By the way, instead of {{ }} -indenting the block, you can use delimited blocks, if you like: - -~~~ -define foobar() { - print "Welcome to flavor country!"; +/*--- +Everything is ok +---*/ +import React from 'react'; +const Timer = require('./timer'); +import { Watcher } from './watcher'; +import headline from 'semantic-ui-react/headline'; +import LetsDoThis from 'tequila-ui/LetsDoThis'; +import FancyReactComponent from 'antd/FancyReactComponent'; +import quotes from 'tequila-ui/quotes'; + +const frontMatter = { + title: 'Everything is ok', + quantity: 834 +}; + +export default class Testmarkdown extends React.PureComponent { + render() { + const props = this.props; + return ( +
+ An h1 header + +

Paragraphs are separated by a blank line.

+

+ 2nd paragraph. Italic, bold, and{' '} + monospace. Itemized lists look like: +

+
    +
  • this one
  • +
  • that one
  • +
+ +

Block quotes are written like so.

+
+

An h2 header

+

Here's a numbered list:

+
    +
  1. first item
  2. +
  3. second item
  4. +
  5. third item
  6. +
+

+ Note again how the actual text starts at 4 columns in (4 characters + from the left side). Here's a code sample: +

+ Let me re-iterate ... +

+ {' '} + for i in 1 .. 10 {'{'} do-something(i) {'}'} +

+

+ As you probably guessed, indented 4 spaces. By the way, instead of{' '} + + indenting the block, you can use delimited blocks, if you like: +

+
+          
+            define foobar() {'{'}
+            {'\n'}
+            {'    '}print "Welcome to flavor country!";{'\n'}
+            {'}'}
+            {'\n'}
+          
+        
+

+ Image of Yaktocat +

+ +

+ (which makes copying & pasting easier). You can optionally mark the + delimited block for Pandoc to syntax highlight it: +

+
+          
+            import time{'\n'}# Quick, count to ten!{'\n'}for i in range(10):
+            {'\n'}
+            {'    '}# (but not *too* quick){'\n'}
+            {'    '}time.sleep(0.5){'\n'}
+            {'    '}print i{'\n'}
+          
+        
+
+          
+            $ cd dillinger{'\n'}$ npm install -d{'\n'}$ node app{'\n'}
+          
+        
+

An h3 header

+

Now a nested list:

+
    +
  1. +

    First, get these ingredients:

    +
      +
    • carrots
    • +
    • celery
    • +
    • lentils
    • +
    +
  2. +
  3. +

    Boil some water.

    +
  4. +
  5. +

    Dump everything in the pot and follow this algorithm:

    +

    + {' '} + find wooden spoon uncover pot stir cover pot balance wooden spoon + precariously on pot handle wait 10 minutes goto first step (or + shut off burner when done) +

    +
  6. +
+

+ Here's a link to a website, to a{' '} + local doc, and to a{' '} + section heading in the current doc. Here's + a footnote [^1]. +

+

[^1]: Footnote text goes here.

+
+ Spoiler text + whatever +
+ + + + + + + + + + + + + + + + + + +
First HeaderSecond Header
Content CellContent Cell
Content CellContent Cell
+

+ named links to Google +
+ http://fest.com/ +

+ React test + +
+ ); + } } -~~~ - -![Image of Yaktocat](https://octodex.github.com/images/yaktocat.png) - -{{ }} -(which makes copying & pasting easier). You can optionally mark the -delimited block for Pandoc to syntax highlight it: - -~~~python -import time -# Quick, count to ten! -for i in range(10): - # (but not *too* quick) - time.sleep(0.5) - print i -~~~ - -```bash -$ cd dillinger -$ npm install -d -$ node app -``` - - - -### An h3 header - -Now a nested list: - - 1. First, get these ingredients: - - * carrots - * celery - * lentils - - 2. Boil some water. - - 3. Dump everything in the pot and follow - this algorithm: - - find wooden spoon - uncover pot - stir - cover pot - balance wooden spoon precariously on pot handle - wait 10 minutes - goto first step (or shut off burner when done) - -Here's a link to [a website](http://foo.bar), to a [local -doc](local-doc.html), and to a [section heading in the current -doc](#an-h2-header). Here's a footnote [^1]. - -[^1]: Footnote text goes here. - - -
- Spoiler text - whatever -
- -First Header | Second Header -------------- | ------------- -Content Cell | Content Cell -Content Cell | Content Cell - -named links to [Google](http://google.com/) - - - - -# React test -{{ }} \ No newline at end of file