This project is currently developed for D8-only, and makes a text filter available to be added to text formats. It simply parses the text field for heading elements using an xpath query, assigns ids to them, and generates a hierarchial table of contents that is prepended to the field content.
Link to project page https://www.drupal.org/sandbox/lpeabody/2594843
Clone via git clone --branch 8.x-1.x http://git.drupal.org/sandbox/lpeabody/2594843.git toc_text_filter
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | toc_screenshot.png | 74.73 KB | danny_joris |
Comments
Comment #2
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #3
mikemiles86In src/Plugin/Filter/FilterToc.php on line #61.
you should be using \Drupal::l() to build the link.
Comment #4
lpeabody commentedThanks for the comment @mikemiles86. I've updated the 8.x-1.x branch which contains these changes.
Comment #5
danny_joris commentedAutomated Review
There are a few minor code style improvements possible: http://pareview.sh/pareview/httpgitdrupalorgsandboxlpeabody2594843git-8x-1x
Manual Review
- I did find one bug where a list item isn't nested in
<ol></ol>tags. Maybe it's because the header nesting didn't happen in the correct order? See attached screenshot.- I'm also wondering if the ordered list style won't be a hindrance rather than an advantage in some cases. Maybe this can be configurable? Currently this renders nested lists with single digits. I would think a notation like this: 2.1) 2.1.1) 2.1.2), etc is often preferred. Adding support for CSS counters could be something to look into.
Comment #6
asiby commentedThe are still few errors found by the automated review as mentioned by Danny.
Comment #7
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.