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

Demo #6

Open
TimothyGu opened this issue Aug 27, 2016 · 5 comments
Open

Demo #6

TimothyGu opened this issue Aug 27, 2016 · 5 comments

Comments

@TimothyGu
Copy link
Member

No description provided.

@ForbesLindesay
Copy link
Member

This should ideally be a bit like a mini IDE for pug. Letting you create a number of pug files, and edit the locals provided to the pug files (with full JavaScript support, not just JSON). It should then let you view the resulting HTML (beautified and minified). It should also offer advanced options for viewing the JavaScript that's generated (by compileClient), the tokens, AST etc. at different stages in the parsing process.

Eventually, it would be great if it offered support for writing plugins in the browser.

It should ideally also support running against a local version of pug somehow (i.e. as much as possible it should probably be a separate app to the main pug website).

Since pugjs.org is a static website, this needs to all be done client side. The best way to achieve that is probably to build a mock file system that implements fs.readFileSync.

The final feature that is really important/exciting is that it should provide permalinks, so that you can create a demo of a bug using this web app, then provide that permalink in a GitHub issue.

@TimothyGu
Copy link
Member Author

I believed Gist support was mentioned a while ago, and I do still think it's a good idea.

For a local version, we could probably use a Service Worker to cache the JS files.

@ForbesLindesay
Copy link
Member

Yes, gist should allow us to keep the permalink urls short (lets us swap a bunch of files for a single number).

The local version would need to be some kind of tool you installed via npm. You'd then run something like:

pug-debugger --pug-linker ./

which would run this "app" with the current directory instead of the pug-linker published to npm.

@TimothyGu
Copy link
Member Author

Sorry, I'm not sure I'm catching what you mean. So this pug-debugger program would be one such that has all the Pug modules bundled? Or is ./ a patched version of pug-linker, which pug-debugger just substitutes in for the pug-linker installed in node_modules?

@ForbesLindesay
Copy link
Member

pug-debugger would bundle the latest versions of all the individual pug modules, but using --pug-linker ./ would override the bundled version with the patched version residing in ./, allowing you to test changes to the linker.

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

No branches or pull requests

2 participants