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

No dedicated documentation #9

Open
TimothyGu opened this issue Jan 10, 2015 · 27 comments
Open

No dedicated documentation #9

TimothyGu opened this issue Jan 10, 2015 · 27 comments
Assignees
Labels
documentation enhancement New feature or request

Comments

@TimothyGu
Copy link
Collaborator

I am sure this is on someone's TODO list but just adding a bug to track it. By dedicated documentation, I mean a website with all the API methods, options, etc., like Jade's.

@mde
Copy link
Owner

mde commented Jan 10, 2015

When you say dedicated docs, do you mean something beyond the README? Are you thinking GH pages, or an actual site?

@TimothyGu
Copy link
Collaborator Author

Are you thinking GH pages, or an actual site?

Either one is fine. My hope is that there is a nice page with all the things about EJS (v2) that pops up first on Google, not this, not this, and not this.

@mde
Copy link
Owner

mde commented Jan 10, 2015

Good call. Thanks for opening this issue to get the ball rolling.

@dougwilson
Copy link

Btw, if you can get tj to move the repo, it would go a long way getting people to the right place. You can delete this one, have tj move his t you here, and then just replace it's contents with your current git code. This way the tj/ejs URL would redirect here and all the issues would too :)

@TimothyGu
Copy link
Collaborator Author

@dougwilson +1

@mde
Copy link
Owner

mde commented Jan 11, 2015

I didn't really want to take that approach because I wanted to be super respectful of TJ's authorship of v1, and because the v2 is actually an older version of EJS of mine (circa 2008 or so) with a completely different implementation and its own commit history. I suppose it would be possible to do something like that and preserve the history of both repos.

@dougwilson
Copy link

Ah. I didn't realize they don't even share the same history, though :) I just saw a really large number of commits here, haha. The other repo could probably at least have a notice added to the top of the readme, if not already there. The biggest thing is I see that people keep filing new issues over there, but at least I see you're watching to repo :D

@mde
Copy link
Owner

mde commented Jan 11, 2015

I did add a notice to the top of the README, but it could be made more obvious. Maybe replace the entire README.

@dougwilson
Copy link

Ah, yea, but it's probably confusing. It sounds like you're just pointing people to some future module. It should probably be clearer that your module replaces that and issues shouldn't even be filed there (unless you plan to make 1.x bug fix releases or something).

@TimothyGu
Copy link
Collaborator Author

Even more confusing: https://www.npmjs.com/package/ejs2

@mde
Copy link
Owner

mde commented Jan 11, 2015

@dougwilson Good call. Probably just blowing the README away and replacing it with nothing but a single clear message that says v2 has replaced v1 completely, and no further maintenance is happening there.

@TimothyGu Oh, wow. This is pretty terrible. Maybe we can convince him to unpublish.

@TimothyGu TimothyGu self-assigned this Jan 11, 2015
@TimothyGu
Copy link
Collaborator Author

@mde simontabor/serenity-ejs#2

Back to the original topic of documentation. I can add some JSDoc inline docs and maybe move the documentation in README to a GH pages. I'll submit a PR when I finished.

@TimothyGu TimothyGu added enhancement New feature or request documentation labels Jan 12, 2015
@puzrin
Copy link

puzrin commented Jan 16, 2015

Can you advice a safe & simple way, to distinguish between 2.x and older versions? Needed for transparent legacy support.

@mde
Copy link
Owner

mde commented Jan 16, 2015

@TimothyGu This is great. I'm back and forth with the owner of ejs.co, but the cost might be prohibitively high.

@mde
Copy link
Owner

mde commented Jan 16, 2015

@puzrin, I assume you mean something other than the package.json? You want something that lives on the exported object?

@puzrin
Copy link

puzrin commented Jan 16, 2015

https://github.com/nodeca/mincer/blob/master/lib/mincer/engines/less_engine.js#L99 see example for less (it's ugly, i know).

Sometime it's not acceptable to have strict versions dependencies. So, adapter has to detect library version somehow, to make proper call. Library can be passed via params, we can't rely on require('ejs/package.json')

var ejs; // here can be v1.x or v2.x

/* How to distinguish? */

I'm asking in docs, because question seems related to "migration guide"

@mde
Copy link
Owner

mde commented Jan 16, 2015

I've done something like this before, making it part of the build/release process:

https://github.com/mde/timezone-js/blob/master/src/date.js#L58

It makes total sense for client-side use. Could you open a GH Issue for this?

@mde
Copy link
Owner

mde commented Jan 18, 2015

Looks like we'll be getting ejs.co for our doc site. I have just have to finalize the payment arrangements.

@TimothyGu
Copy link
Collaborator Author

@mde oh wow, thanks

@mde
Copy link
Owner

mde commented Jan 18, 2015

@puzrin, versioning-detection issue here: #30

@puzrin
Copy link

puzrin commented Jan 23, 2015

@mde thanks!

@TimothyGu
Copy link
Collaborator Author

Syntax documentation done in #29.

API documentation in JSDoc form done in #45.

@mde
Copy link
Owner

mde commented Feb 6, 2015

Site is on the way. First cut of it lives here for now: https://github.com/mde/ejs-site

@mde
Copy link
Owner

mde commented Feb 6, 2015

New site is up at http://ejs.co -- not much there yet, basically just brochureware with a copy of what's in the README. But a step in the right direction.

@TimothyGu
Copy link
Collaborator Author

@mde Already looking nice though. Nice job! :)

@RyanZim
Copy link
Collaborator

RyanZim commented May 30, 2016

@mde Do you still have push access to tj/ejs?

If so, how about putting a notice like this at the top of the README:

This repo is UNMAINTAINED

EJS v2 is now being actively developed at https://github.com/mde/ejs

Please report all issues there.

If you are upgrading from v1, you may want to look an the CHANGELOG for v2.

@kjkent
Copy link

kjkent commented Jul 17, 2024

It would be great to see the existing documentation built upon. Perhaps as a result of features being added/removed over the years, or perhaps that it's easy to forget while writing docs that others may not have the same insights/familiarity, some of the existing wording is not very comprehensible unless already familiar with the topic. An example:

  • Layouts:

    EJS does not specifically support blocks, but layouts can be implemented by including headers and footers...

    There's a bunch of open issues, PRs, comments regarding reusing layouts, the deprecation of partial, introduction of include, but no clear explanation of what limitation is being expressed by 'does not specifically support blocks'. It's the first sentence in a section about creating layouts. As a page can be composed of more than header/footer/main content, what's being said here? An unaware person would likely look to the include docs to find out:

  • Include:

    Includes are relative to the template with the include call. (This requires the 'filename' option.) For example if you have "./views/users.ejs" and "./views/user/show.ejs" you would use <%- include('user/show'); %>.

    You'll likely want to use the raw output tag (<%-) with your include to avoid double-escaping the HTML output.

    But... what can I include? The docs suggest other EJS files, but the first sentence of the Layouts section tells me EJS doesn't specifically support blocks, which presumably means the EJS I'm including must have some constraints.

Both of the above sections skip a few links in the 'what, why, where, when, how' chain of understanding; both discussing very specific syntax without a explaining the basic function and use cases. Working on the docs is a time investment that pays back in less "how does this work?" issues being filed, and a much nicer time for users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants