-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Improved and fixed twig reference #4313
Conversation
@@ -19,162 +19,644 @@ There may also be tags in bundles you use that aren't listed here. | |||
Functions | |||
--------- | |||
|
|||
.. _function.render: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are reference names global to the whole doc or only to the current file ? If they are global, it should at least be twig_function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are global. So it's indeed better to choose a more qualified label here.
Thanks @stof, I applied both comments. |
@@ -19,162 +19,645 @@ There may also be tags in bundles you use that aren't listed here. | |||
Functions | |||
--------- | |||
|
|||
.. _reference_twig.function.render: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about _reference-twig-function-render
instead? We use dashes instead of underscores or dots for labels most of the time.
|
||
{{ render(uri, options) }} | ||
|
||
uri |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to put uri
into literals?
Thanks @xabbuh ! I've fixed them all |
b7d8bc0
to
ad6b084
Compare
👍 |
I think this is really great - it will be possible now to link to specific things and we won't be squeezed into the little table. The table was a great start, now we're growing out of it :). With the limited markup control we have, what do you think about trying to create something at the top of this page like the table-of-contents that Twig has on its docs (scroll down to "Twig Reference": http://twig.sensiolabs.org/documentation). We don't have a lot of space to work with, so here's my idea:
* Functions
* Filters
* etc At the top of each section, have a list of the individual items themselves (as links of course): Functions
---------
* `path()`
* `asset()`
* etc What do you think? Any improvements on this idea? |
We already have a table of contents which, due tot the document outline, will be ordered as:
I don't see how links will make this better, apart from it making the document very long |
The issue with the TOC is that you first have to scroll down to reach it if you don't have a very large screen. Though I'm not sure if this fact really justifies adding links to the sections to the top of this document. |
I agree with @xabbuh, I think the left TOC won't be much help because of the length on this document. Let's just merge this in and see how it looks (to decide if we want header-links at the top and possibly specific links at the top of each section). |
This PR was merged into the 2.3 branch. Discussion ---------- Improved and fixed twig reference | Q | A | --- | --- | Doc fix? | yes | New docs? | yes | Applies to | 2.3+ | Ficket tickets | #4301 Removed the ugly looking tables and added some more details. Commits ------- ad6b084 Improved and fixed twig reference
We already have some introductory text. I reworded it a bit and linked parts of it directly to the sections (see #4432). I think we won't need any faky TOC then. |
Removed the ugly looking tables and added some more details.