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

Improved and fixed twig reference #4313

Merged
merged 1 commit into from
Nov 7, 2014

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Oct 10, 2014

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.

@@ -19,162 +19,644 @@ There may also be tags in bundles you use that aren't listed here.
Functions
---------

.. _function.render:
Copy link
Member

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

Copy link
Member

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.

@wouterj
Copy link
Member Author

wouterj commented Oct 19, 2014

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:
Copy link
Member

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
Copy link
Member

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?

@wouterj
Copy link
Member Author

wouterj commented Oct 31, 2014

Thanks @xabbuh ! I've fixed them all

@xabbuh
Copy link
Member

xabbuh commented Oct 31, 2014

👍

@weaverryan
Copy link
Member

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:

  1. At the top of the article, just have a list (with links of):
* 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?

@wouterj
Copy link
Member Author

wouterj commented Nov 6, 2014

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:

  • Functions
    • render
    • render_esi
    • ...
  • Filters
    • ...
  • Tests
    • ...

I don't see how links will make this better, apart from it making the document very long

@xabbuh
Copy link
Member

xabbuh commented Nov 6, 2014

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.

@weaverryan
Copy link
Member

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).

@weaverryan weaverryan merged commit ad6b084 into symfony:2.3 Nov 7, 2014
weaverryan added a commit that referenced this pull request Nov 7, 2014
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
@xabbuh
Copy link
Member

xabbuh commented Nov 7, 2014

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.

@wouterj wouterj deleted the improve_twig_reference branch November 7, 2014 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants