Migration to webpack#162
Migration to webpack#162ichiriac merged 21 commits intoglayzzle:masterfrom b4dnewz:migration/webpack
Conversation
Added a npmignore rule for this folder
Using documentationjs it will read the source files and create markdown documentation from them
Fixed dependencies Linted webpack config file Stripped old grunt config
|
I've restored the old grunt/grunt-documentation deps and tried to generate the documentation and the output is different, also I've tried to checkout the master branch and regenerate documentation and the output is still different so I guess the documentation is just old and there are no changes in the plugin, here a sample of a diff: I guess using this file is cool and I can remove grunt and use documentationjs node api to replace the grunt task. |
|
Hi @b4dnewz, I like the JSDoc output but when I have to read that kind of documentation the hard part is that everything is mixed and information is condensed. I want to provide a simple quick start and don't bother the reader with too technical information about internal functions from the API. Maybe by using another template could help, like this one https://github.com/braintree/jsdoc-template/ or this one : https://github.com/docstrap/docstrap#readme Do we can add cookbook pages on JSDoc in order to also provide some mini tutorials ? If the html output is clean and readable, we may give up the markdown version, no more need to maintain it. |
ichiriac
left a comment
There was a problem hiding this comment.
great work, it will be really awesome !!
| /.coveralls.yml | ||
| /.istanbul.yml | ||
| /.travis.yml No newline at end of file | ||
| /.travis.yml |
example/index.html
Outdated
| </a> | ||
| </div> | ||
| <div class="md-toolbar-section-end"> | ||
| <md-checkbox v-model="live" true-value="true" false-value="false">Live Mode</md-checkbox> |
There was a problem hiding this comment.
could you provide extra options ;
- Positions
- Comments
- Extract the source
- Extract tokens
- Failover on errors
example/index.html
Outdated
| </md-field> | ||
| </div> | ||
| <div class="md-layout-item md-size-40 output-container"> | ||
| <pre v-text="output"></pre> |
There was a problem hiding this comment.
could you use a JSON formatter like for example https://myst729.github.io/vue-json-tree/ ?
For huge outputs it should be simpler to navigate
There was a problem hiding this comment.
BTW, I really like to demo, I've tried it online here : https://rawgit.com/b4dnewz/php-parser/migration/webpack/example/index.html
| "author": "Ioan CHIRIAC", | ||
| "contributors": [ | ||
| { | ||
| "name": "Filippo Conti", |
Using a different template and added support for tutorials pages
|
Excellent ! Can I merge ? |
|
hi @ichiriac good morning, I was about to write you, just few minutes because I found in the documentation the tutorials give a 404 caused from a bad href reference. also i've excluded the docs, tutorials from eslint to avoid codeclimate gets angry :) |
|
hi @b4dnewz, good morning :) I really like the new demo, you have done a great job here ! |
Renamed tutorial files (404 error on href) Removed old docs generation file
|
Ok.. I'm not exactly sure how to fix codeclimate I though adding docs folder to eslintignore would fix it but I was wrong. Talking about the PR this is was I made: I've updated the demo page including all the parser settings, changed the jsdoc documentation template but as you can see it still needs some customization. I've added some tutorial pages and references here an example. It still need to be completed updating the comments pointing the various parts of the code to their relative example/tutorial if any, I took these from the old docs folder. This branch is behind the master few commits I try to align them and then we can merge if nothing fails. |
Added missing documentation title Rebuild after merging master
Ignore tutorials and docs
| @@ -0,0 +1,3 @@ | |||
| exclude_patterns: | |||
|
Ok I guess if we ignore the codeclimate warning it's ready. |
|
Hi @b4dnewz, I've merged your PR, and as the demo is really cool so I've published it on glayzzle. You have access over https://github.com/glayzzle/glayzzle.github.io - there you can publish changes as you want I think it would be better that the In order to release the docs we can run the generatio from this repository and next we copy/paste the docs folder on the website repository, unless you know a better way to achieve this. |
|
hi @ichiriac, usually I create a custom In our case we can use it to publish the auto generated docs folder, for example in our package.json: "scripts": {
"build": "webpack --config webpack.config.js",
"publish-docs": "git subtree push --prefix docs origin gh-pages"
},Once we publish a new version or update the docs we run npm run publish-docs and we have the documentation hosted on: https://glayzzle.github.com/php-parser Do you like that? |
|
Than for the official website the separate repository it's ok and the Documentation link can point to the php-parser gh-pages |
|
Yes, it's great, I like it ! This way we'll be able to publish on the various packages 👍 |
|
yup, later this evening I'll add the command and publish the first gh-pages with the documentation, ok? |
|
I have to rewrite them, but for a first shot it's OK. When your system will be released it will be easy to update them. You can go ahead and move them to gh-pages Really thanks for your help, without you I'll never get the time to do that sort of user-frendly improvements |
|
no worries, when I have time is always a pleasure to help |
|
@ichiriac i'm proceeding, in order to use git subtree we must track Also, I'm going to setup Algolia DocSearch to enable documentation search as suggested from jsdoc-template, which right now is missing and is quite difficult to navigate the classes, when I've all set up I set your as the owner of that so you can manage and maybe in the future we can use for more documentations, is free (it says) For now I just subtree push the docs as it is until I've configured everything. Am I enabled to do it? (pushing/creating branch) |
|
yes of course, no problem |
|
Ok I made it, but you probably have to set (or check if it is setted) the gh-pages branch in the repository settings if the 404 doesn't go away in few minutes https://glayzzle.github.io/php-parser When it's ready I can use it in the Algolia docsearch creation since it needs to parse the html page first. |
|
hi @ichiriac, good evening I've added the algolia docsearch support as was suggested by the jsdoc theme, here the result. It looks glitchy but depends on the grafic of the theme we are using. By the way there's no login/account in this algolia docsearch thing, it's a manual review they make after you request it for a specific site and they contacted me by email where they gave me (today) the apikey. Once is enabled it will be reloaded once a day and updated in their database. That's it. I've also added a package.json script to publish the documentation with |
|
Hi @b4dnewz, The search engine is really helpfull and I like the result display. I hope the opensource plan will be enough but anyway, it's a great feature. Do you think we could integrate the playground demo as a custom page of the documentation ? I've forked the template here https://github.com/glayzzle/jsdoc-template, so we will be able to customise or fix css if needed. |
Good idea, I will try |





Project build
A little recap, grunt is old and slower compared to webpack so I proposed to migrate to it.
This is the build setup using webpack, I've also added the browser field to package.json file pointing to the unminified build for the web projects, it's not ready yet to fully replace grunt we must move the documentation generator also... I've tried also to replicate the grunt-documentation plugin using the documentation npm module but the output is quite different and I don't understand why since the options are the same, probably it's because I'm using a newer version.
Project documentation
TL;DR DEMO
This is the file I've made for programmatical use of documentationjs, but the output is somehow different :( probably depends of the newer version, but I don't know exactly.
I've created another branch to try out jsdoc with this project and managed to make it work after fixing a couple of tags errors, there are still some checks to do, regards examples and other parts of the documentation to ensure they match the jsdoc standard... but this is a preview of the result.
This is the default theme, if you like this solution we can use the theme you like more.
I think in terms of readability and usability is better than the wiki pages, I admit I'm used to read stuff in github, I spend most of my time on it, but since jsdoc (esdoc, tsdoc and friends) are widely used I feel familiar to move around the documentation generated by that tools.
The idea is to migrate the documentation, merge it in the webpack branch and than merge back into v3.1.
What do you think about it?