-
Notifications
You must be signed in to change notification settings - Fork 10
Move documentation into template includes #18
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
Conversation
Thank you for taking the time to submit a patch. However, I don't want to list how to do add locals for every template engine tilt supports to the README. The only reason that there are two examples instead of a single example now is that doing so for string templates is not obvious even if you know how string templates work. As doing so for slim templates is obvious if you know how slim templates work, I don't want to add examples for slim (or other template libraries). I have been thinking about expanding the documentation for each template library, and this would be a good thing to mention on a slim-specific documentation page. Would you be interested in working on a general documentation refactoring? |
As always thanks for the prompt reply. I happen to use slim for my projects so I thought it might be helpful to list share the syntax since I stumbled a little myself (missing the pound sign after the comment forward slashes). I can understand not wanting to pollute the main readme with implementation details for each language though.
I'd like to help with the documentation, do you have an overall (file) structure in mind?
…
On 25/06/11 at 16:36, <Jeremy Evans ***@***.***)> wrote:
jeremyevans left a comment (jeremyevans/tilt#18) (#18 (comment))
Thank you for taking the time to submit a patch. However, I don't want to list how to do add locals for every template engine tilt supports to the README. The only reason that there are two examples instead of a single example now is that doing so for string templates is not obvious even if you know how string templates work. As doing so for slim templates is obvious if you know how slim templates work, I don't want to add examples for slim (or other template libraries).
I have been thinking about expanding the documentation for each template library, and this would be a good thing to mention on a slim-specific documentation page. Would you be interested in working on a general documentation refactoring?
—
Reply to this email directly, view it on GitHub (#18 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAAM77QCM6AYXNQBP3EBNYL3DA5H5AVCNFSM6AAAAAB7CXDBCWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNRTGA4TIMJWHA).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I was thinking of having comments at the top of each template engine file, with all of the details for the template engine. RDoc will render these as file-level documentation, and we could have the README link to each page using |
Sounds good, I'll have a go at this.
Closing this for now.
…
On 25/06/11 at 18:23, <Jeremy Evans ***@***.***)> wrote:
jeremyevans left a comment (jeremyevans/tilt#18) (#18 (comment))
I was thinking of having comments at the top of each template engine file, with all of the details for the template engine. RDoc will render these as file-level documentation, and we could have the README link to each page using rdoc-ref. We currently have some template details in doc/TEMPLATES.md. The template-engine specific documentation could be moved to the template files, and the non-template-engine specific documentation could be moved to the README if it is useful and not redundant.
—
Reply to this email directly, view it on GitHub (#18 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAAM77S3QWHKJ3A6RNW35RT3DBJYRAVCNFSM6AAAAAB7CXDBCWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNRTGQ2TKMZUGY).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
@jeremyevans: Sorry to bother you, but can you elaborate on the |
Actually, linking to Note that GitHub doesn't handle rdoc-ref. The plan is to use rdoc to build the documentation website, and host the website on GitHub Pages. |
I got as far as linking to the page via # frozen_string_literal: true
require_relative 'template'
require 'slim'
module Tilt
# Some details about the slim engine
#
# == Embedded locals
#
# In slim templates, the comment format looks like this:
#
# //# locals: ()
class SlimTemplate < Slim::Template
end
end It's not ideal since it changes |
Does |
It doesn't for me, but my RDoc-foo is not very impressive.
…
On 25/06/12 at 18:55, <Jeremy Evans ***@***.***)> wrote:
jeremyevans left a comment (jeremyevans/tilt#18) (#18 (comment))
Does {Slim}[rdoc-ref:lib/tilt/slim.rb] not work to link to the file-level documentation?
—
Reply to this email directly, view it on GitHub (#18 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAAM77RF4EIXHOTAOSCCE633DGWIPAVCNFSM6AAAAAB7CXDBCWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNRXGU3TOOBXGA).
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
I don't want to waste your time. I'll see if I can get a basic framework working in the next few days. If that is successful, then it would just require the drudge work of moving and writing documentation. If I cannot get it to work, I'll need to choose a different approach. |
It's not you, it's a bug or limitation in rdoc. rdoc-ref allows linking to non- |
rdoc PR: ruby/rdoc#1376 |
I just checked back here and noticed that your rdoc PR was merged. I'll take a 2nd stab at this in the coming days. |
Awesome, thanks for following up! |
I'm still not getting the desired files to be created, but maybe I'm just being thick: ❯ rdoc --version
6.14.2-pre # my local installation to have stuff from master
❮ cat lib/tilt/slim.rb
# frozen_string_literal: true
require_relative 'template'
require 'slim'
# Some details about the slim engine
#
# == Embedded locals
#
# In slim templates, the comment format looks like this:
#
# //# locals: ()
Tilt::SlimTemplate = Slim::Template
❯ ag Slim README.md
52:| {Slim}[rdoc-ref:lib/tilt/slim.rb] | .slim | slim |
❯ rdoc
Parsing sources...
100% [46/46] /Users/muellerj/src/tilt/lib/tilt/yajl.rb
Generating Darkfish format into /Users/muellerj/src/tilt/doc...
You can visit the home page at: file:///Users/muellerj/src/tilt/doc/index.html
Files: 46
Classes: 25 ( 5 undocumented)
Modules: 4 ( 1 undocumented)
Constants: 26 (11 undocumented)
Attributes: 12 ( 2 undocumented)
Methods: 114 (63 undocumented)
Total: 181 (82 undocumented)
54.70% documented
Elapsed: 0.6s
❯ ag Slim doc/README_md.html
304:<td><a href="lib/tilt/slim_rb.html">Slim</a></td>
❯ ls doc/lib/tilt
ls: doc/lib/tilt: No such file or directory
❯ ag slim doc
doc/created.rid
42:/Users/muellerj/src/tilt/lib/tilt/slim.rb Fri, 05 Sep 2025 09:39:25 +0200
doc/CHANGELOG_md.html
238:<p>Ship slim template support with tilt (minad) (#4)</p>
418:<p>Add Slim as an external template engine (judofyr)</p>
doc/Tilt.html
175: <dt id="SlimTemplate">SlimTemplate
177: <p>Some details about the slim engine</p>
181:<p>In slim templates, the comment format looks like this:</p>
doc/README_md.html
304:<td><a href="lib/tilt/slim_rb.html">Slim</a></td>
305:<td>.slim</td>
306:<td>slim</td> Note how the link to |
Install the hanna gem, and use |
Got it to work, thanks for the pointer. I'll move the descriptions from |
See #21 |
No description provided.