npm-scripts / scripts

Collection of useful npm-scripts!
http://git.io/npm-scripts
MIT License
172 stars 8 forks source link

add script to create toc and to create all #7

Closed stoeffel closed 9 years ago

stoeffel commented 9 years ago

adds npm run generate and npm run create-toc

stoeffel commented 9 years ago

@tomekwi is there a way to add a newline after the last content between the inject-tags? To avoid this:

screen shot 2015-07-06 at 20 17 14

maybe we could add a custom footer/header to doxie.inject or a beforeAll afterAll option.

tomek-he-him commented 9 years ago

So far nothing was added. I treated newline as many Unix programs – as End Of Line. So if your docs end with a newline, there is a newline.

But I guess I’ll add a check for that – and if the docs don’t end with a newline, I’ll add one. I think cat does the same thing.

tomek-he-him commented 9 years ago

beforeAll and afterAll could be another plugin. It’s very simple to do, just emit some docs at the beginning or end, like:

{
  output: "This will be at the end"
}
stoeffel commented 9 years ago

:checkered_flag:

stoeffel commented 9 years ago

Two commits from @tomekwi sneaked there way in there. Do you guys mind??? Otherwise this is good to go and can be changed later to remove the list/newline workaround.

tomek-he-him commented 9 years ago

Looks great to me!

stoeffel commented 9 years ago

hmmm... I don't like the index approach. I think the only usecase is to inser content before or after the rendered content. --insert '\n' afterContent

tomek-he-him commented 9 years ago

Then we’ll start minimal. Just --insert '\n'. It’s easy to add options later, harder to take them away.

stoeffel commented 9 years ago

Then we’ll start minimal. Just --insert '\n'. It’s easy to add options later, harder to take them away.

SGTM

stoeffel commented 9 years ago

will rebase once again asap. :smile_cat:

stoeffel commented 9 years ago

rebased. can we merge this? @npm-scripts/owners

hemanth commented 9 years ago

Done :+1:

Thank you!

tomek-he-him commented 9 years ago

@stoeffel @hemanth I’ve made doxie.append today. Here’s the thing at work: https://github.com/studio-b12/mve/blob/b1d7209/package.json#L17.

hemanth commented 9 years ago

Nice, is there any way to avoid that echo '[]' | ?

tomek-he-him commented 9 years ago

At the moment not :(. doxie expects a JSON array over stdin – so if you call it without passing a string it switches into interactive input.

There is one reasonable option to prevent this – write another CLI for doxie-core which pipes an empty array into it.

hemanth commented 9 years ago

:8ball: