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

Use Babel package doc #990

Merged
merged 6 commits into from Nov 22, 2016

Conversation

Projects
None yet
3 participants
@xtuc
Member

xtuc commented Nov 19, 2016

Refers to issue #528.

NPM package page shows the header but the website already have one. I had to write a custom plugin to drop these lines. It uses the page.package to determine its README location.

I assumed that the header (package title and description) takes three lines.

There is a git module to include babel package repository.

This PR shows only a demo. Many documentations from the babel repo and from the website are very different.

@hzoo

This comment has been minimized.

Show comment
Hide comment
@hzoo

hzoo Nov 19, 2016

Member

Sounds like a good start! - will check it out later

Member

hzoo commented Nov 19, 2016

Sounds like a good start! - will check it out later

Show outdated Hide outdated _plugins/markdown.rb
@@ -0,0 +1,23 @@
=begin

This comment has been minimized.

@jamiebuilds

jamiebuilds Nov 20, 2016

Member

Do you need a plugin to do this? Couldn't you just use a normal includes with a {% capture %}?

@jamiebuilds

jamiebuilds Nov 20, 2016

Member

Do you need a plugin to do this? Couldn't you just use a normal includes with a {% capture %}?

This comment has been minimized.

@xtuc

xtuc Nov 20, 2016

Member

While it seems possible to do it with capture and some filters (https://github.com/Shopify/liquid/wiki/Liquid-for-Designers#standard-filters), it is much more conviennient to use it this way.

Also, from my point of view this gives you more flexibilty because all calls goes throught the Tag.

@xtuc

xtuc Nov 20, 2016

Member

While it seems possible to do it with capture and some filters (https://github.com/Shopify/liquid/wiki/Liquid-for-Designers#standard-filters), it is much more conviennient to use it this way.

Also, from my point of view this gives you more flexibilty because all calls goes throught the Tag.

This comment has been minimized.

@jamiebuilds

jamiebuilds Nov 21, 2016

Member

GitHub Pages will not build with any plugins, so you don't even have the option to use it

@jamiebuilds

jamiebuilds Nov 21, 2016

Member

GitHub Pages will not build with any plugins, so you don't even have the option to use it

This comment has been minimized.

@xtuc

xtuc Nov 21, 2016

Member

Ok thanks, I see. It was quite obvious, they won't run arbitrary Ruby code.

I will update with a fallback.

@xtuc

xtuc Nov 21, 2016

Member

Ok thanks, I see. It was quite obvious, they won't run arbitrary Ruby code.

I will update with a fallback.

Show outdated Hide outdated _includes/package_readme.html
{{ readme
| newline_to_br
| split: "<br />"
| slice: 4, 1000

This comment has been minimized.

@xtuc

xtuc Nov 22, 2016

Member

I also can use shift there.

Like this :

    | split: "<br />"
    | shift
    | shift
    | shift
    | shift
    | join: "<br />"

This way I don't need to limit the string to 1000 but I don't like it.
Do you mind @thejameskyle ?

@xtuc

xtuc Nov 22, 2016

Member

I also can use shift there.

Like this :

    | split: "<br />"
    | shift
    | shift
    | shift
    | shift
    | join: "<br />"

This way I don't need to limit the string to 1000 but I don't like it.
Do you mind @thejameskyle ?

This comment has been minimized.

@hzoo

hzoo Nov 22, 2016

Member

This is to remove the first 4 header lines at the top of every readme https://raw.githubusercontent.com/babel/babel/master/packages/babel-plugin-syntax-async-generators/README.md - they all ahve it so it should be ok as a workaround (using shift).

@hzoo

hzoo Nov 22, 2016

Member

This is to remove the first 4 header lines at the top of every readme https://raw.githubusercontent.com/babel/babel/master/packages/babel-plugin-syntax-async-generators/README.md - they all ahve it so it should be ok as a workaround (using shift).

@@ -0,0 +1,3 @@
[submodule "_includes/babel"]

This comment has been minimized.

@hzoo

hzoo Nov 22, 2016

Member

We'll need to add some instructions to the readme or add that automatically in make serve/npm start?

git submodule init
git submodule update
@hzoo

hzoo Nov 22, 2016

Member

We'll need to add some instructions to the readme or add that automatically in make serve/npm start?

git submodule init
git submodule update

This comment has been minimized.

@xtuc

xtuc Nov 22, 2016

Member

Personally I would use : git clone --recursive [repo.git]

@xtuc

xtuc Nov 22, 2016

Member

Personally I would use : git clone --recursive [repo.git]

This comment has been minimized.

@hzoo

hzoo Nov 22, 2016

Member

whatever makes sense and so the user can just run npm start/make serve

@hzoo

hzoo Nov 22, 2016

Member

whatever makes sense and so the user can just run npm start/make serve

This comment has been minimized.

@xtuc

xtuc Nov 22, 2016

Member

The user won't even notice the change : https://github.com/xtuc/babel.github.io/blob/66f5f362840aa251ff3ea1bbfbf1eacef217cd1b/Makefile#L18. make serve is called from the start npm script.

@xtuc

xtuc Nov 22, 2016

Member

The user won't even notice the change : https://github.com/xtuc/babel.github.io/blob/66f5f362840aa251ff3ea1bbfbf1eacef217cd1b/Makefile#L18. make serve is called from the start npm script.

@hzoo

This comment has been minimized.

Show comment
Hide comment
@hzoo

hzoo Nov 22, 2016

Member

LGTM we can make an issue or just iterate on the whole remove first 4 lines thing

Member

hzoo commented Nov 22, 2016

LGTM we can make an issue or just iterate on the whole remove first 4 lines thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment