Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix in the createDocs function #13

Open
wants to merge 35 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
21aac39
Update README.md
jmanek Aug 14, 2015
1932512
Update LICENSE
jmanek Aug 15, 2015
7d5008b
Update marked.js
jmanek Aug 15, 2015
c12624e
Update README.md
jmanek Aug 19, 2015
a42d7ee
enhanced node modules handling
DoomyTheFroomy May 11, 2016
24c23c1
Merge pull request #2 from DoomyTheFroomy/master
jmanek May 15, 2016
013b647
Merge remote-tracking branch 'jmanek/master'
DoomyTheFroomy May 25, 2016
2deefe5
Enabled includes
DoomyTheFroomy May 25, 2016
bca609c
Merge pull request #4 from DoomyTheFroomy/master
jmanek May 25, 2016
f41bbb2
Update README.md
jmanek May 25, 2016
e7186b1
Merge remote-tracking branch 'jmanek/master'
DoomyTheFroomy May 26, 2016
a04263c
Enabled named language tabs
DoomyTheFroomy May 26, 2016
430e0f6
Merge pull request #5 from DoomyTheFroomy/master
jmanek May 30, 2016
2bde71b
Create syntax-highlighting alias shell for bash
MikeRalphson Oct 7, 2016
a232ae6
Correct license in package.json
MikeRalphson Oct 7, 2016
7b740c0
Merge pull request #6 from MikeRalphson/master
jmanek Oct 7, 2016
4905453
Merge pull request #7 from MikeRalphson/patch-2
jmanek Oct 7, 2016
9f2fef6
Update README.md
jmanek Sep 3, 2018
383015f
Update README.md
jmanek Sep 3, 2018
a10dc57
Update README.md
jmanek Sep 3, 2018
3b349a9
No build option, update syntax
jmanek Sep 9, 2018
98ce66c
Update README.md
jmanek Sep 9, 2018
f158c0d
Update README.md
jmanek Sep 9, 2018
8a23a2a
package
jmanek Sep 9, 2018
15a09a8
2.0.1
jmanek Sep 9, 2018
cca933a
dirname
jmanek Sep 9, 2018
2895317
2.0.2
jmanek Sep 9, 2018
cfc7246
Update README.md
jmanek Sep 9, 2018
8b497b1
Update README.md
jmanek Sep 9, 2018
b3f640e
source
jmanek Sep 9, 2018
5026fe0
promise
jmanek Sep 10, 2018
e0095d1
Add serve to deps
jmanek Sep 12, 2018
872aeb4
serve
jmanek Sep 12, 2018
00bf486
sure why not
Nov 18, 2018
4fb7c5c
Update marked version
Nov 2, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ build/
.yardoc
_yardoc
doc/
.idea/
.idea/
node_modules
4 changes: 1 addition & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Copyright 2008-2013 Concur Technologies, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
Expand All @@ -10,4 +8,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
under the License.
53 changes: 39 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
[Slate](https://github.com/tripit/slate) with node.js
========
A port of the documentation generator Slate to node.js.
[See it](http://jmanek.github.io/slate_node/) in action!

I was looking to create API docs and Slate's UI was exactly what I wanted. I came upon this *glaring* issue though. I had to use Ruby! Not that there's anything wrong with that! But I want to be able to host it on our site, and use the same framework throughout to build everything -- I can't justify setting up Ruby to create one page.
A port of the documentation generator Slate to node.js, that can optionally be built in the browser.
[See it](http://jmanek.github.io/slate_node/) in action!

The major difference is the use of [marked](https://github.com/chjj/marked) for parsing the .md, [highlight](https://highlightjs.org/) for syntax highlighting, and [Handlebars](http://handlebarsjs.com/) for templating.


### Running

1. Clone the repo, install the npm modules.
2. Run `node marked.js`
3. This will build the page and save it to /source/index.html
4. You're done!

- Replace /source/index.md with your own markdown to use that instead

### Todo/Bugs

## Building

### Node.js
This outputs to the `build` directory. Replace `source/slate.md` with your own markdown to use that instead
```
git clone https://github.com/jmanek/slate_node.git
npm install
npm run build
# Docs are now viewable at build/index.html
```

### Browser
Alternatively, you can directly serve the `source` directory from a webhost and the documentation will be built at runtime.
```
git clone https://github.com/jmanek/slate_node.git
npm install serve # included in npm install
./node_modules/.bin/serve source
# Docs are now viewable at localhost:5000
```
Any changes to `source/slate.md` will be incorporated into `source/index.html` when it is reloaded. There is now no need to have node.js installed on the machine. This way you don't have to worry about incorpoting Slate into your current build process or creating an entirely new toolchain for it (`python3 -m http.server`). It is a "static" version of Slate. This is inherently slower than the node.js pre-built version, but it is completely independent of operating system or platform. You will not be able to view the documentation until deploying it to a server.

## Code Highlighting
[Numerous themes](https://highlightjs.org/static/demo/) for highlight.js are available in `source/stylesheets/highlight`. You can switch between them by changing this line in `source/index.html`
```html
<link href="stylesheets/highlight/solarized-dark.css" rel="stylesheet" type="text/css" />
```

## Includes
Includes are handled as described in the [Slate Wiki](https://github.com/lord/slate/wiki/Using-Includes). The filename must have an underscore prepended to it, which is not included in the markdown file description.

## Todo/Bugs

- Package it in a more modular way (Grunt?)
- marked seems to be handling tables a bit differently, if there's too many em-dashes it's failing
- highlight.js might have some differences in language detection than Rouge; at the very least 'shell' becomes 'bash'. Ideally this repo should be compatible with any markdown made for Ruby Slate.
- Cleanup how marked parses the top-level settings. Right now they are manually being parsed.
- Actually build the scss/js
87 changes: 0 additions & 87 deletions marked.js

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/handlebars

This file was deleted.

7 changes: 0 additions & 7 deletions node_modules/.bin/handlebars.cmd

This file was deleted.

15 changes: 0 additions & 15 deletions node_modules/.bin/marked

This file was deleted.

7 changes: 0 additions & 7 deletions node_modules/.bin/marked.cmd

This file was deleted.

3 changes: 0 additions & 3 deletions node_modules/handlebars/.gitmodules

This file was deleted.

2 changes: 0 additions & 2 deletions node_modules/handlebars/.istanbul.yml

This file was deleted.

25 changes: 0 additions & 25 deletions node_modules/handlebars/.npmignore

This file was deleted.

80 changes: 0 additions & 80 deletions node_modules/handlebars/CONTRIBUTING.md

This file was deleted.

60 changes: 0 additions & 60 deletions node_modules/handlebars/FAQ.md

This file was deleted.

Loading