Maven Doxia
  1. Maven Doxia
  2. DOXIA-472

No page title is set when using markdown

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.5
    • Component/s: Module - Markdown
    • Labels:
      None

      Description

      No page title is created for pages which are defined with the markup language "markdown". A page in a project named "Test" opened with Chrome for example has the browser title "Test - - Chrome" and the browser tab is labeled with "Test - ". A live example on Maven site: maven-jsr330.html done from maven-jsr330.md

      I recommend using the first headline in the markdown file as a page title.

        Activity

        Hide
        Jason Duke added a comment -

        This would be really useful.

        Show
        Jason Duke added a comment - This would be really useful.
        Hide
        Benjamin Piwowarski added a comment - - edited

        This is already possible by using

        <head><title>Your title</title></head>

        as the first line of your MarkedDown page

        Show
        Benjamin Piwowarski added a comment - - edited This is already possible by using <head><title>Your title</title></head> as the first line of your MarkedDown page
        Hide
        Jason Duke added a comment - - edited

        I have tried what Benjamin Piwowarski suggests, but it does not appear to work, at least not when using doxia and markdown as part of the Maven site generation capabilities. It properly outputs the HTML markup directly inline within the generated page template HTML, which is down in the body. The desired behavior would be for it to contribute to the title used by the site plugin when rendering the actual HTML head element of the page.

        Show
        Jason Duke added a comment - - edited I have tried what Benjamin Piwowarski suggests, but it does not appear to work, at least not when using doxia and markdown as part of the Maven site generation capabilities. It properly outputs the HTML markup directly inline within the generated page template HTML, which is down in the body. The desired behavior would be for it to contribute to the title used by the site plugin when rendering the actual HTML head element of the page.
        Hide
        Klaus Reimer added a comment -

        @Benjamin: Haven't tested it myself so I trust Jason's observation that it doesn't work. Only want to add that even if it worked then this would just be a workaround. In APT format the HTML page title is generated by the plugin by using the main headline specified in APT markup. So for MarkDown the approach should be similar: Use the first headline as HTML page title. Another reason against your solution is that Maven already has some logic to merge the page title with the project title. In your approach this logic must be implemented manually in every page. So this is quite some boiler plate code in markdown files which would be completely unnecessary if the plugin simply used the first markdown headline for the page title.

        Show
        Klaus Reimer added a comment - @Benjamin: Haven't tested it myself so I trust Jason's observation that it doesn't work. Only want to add that even if it worked then this would just be a workaround. In APT format the HTML page title is generated by the plugin by using the main headline specified in APT markup. So for MarkDown the approach should be similar: Use the first headline as HTML page title. Another reason against your solution is that Maven already has some logic to merge the page title with the project title. In your approach this logic must be implemented manually in every page. So this is quite some boiler plate code in markdown files which would be completely unnecessary if the plugin simply used the first markdown headline for the page title.
        Hide
        Joerg Schaible added a comment -

        MultiMarkdown already defines how to add meta information to a markdown document (http://bywordapp.com/markdown/guide.html#section-mmd-meta). Functionality looks similar to what we have with apt.

        Show
        Joerg Schaible added a comment - MultiMarkdown already defines how to add meta information to a markdown document ( http://bywordapp.com/markdown/guide.html#section-mmd-meta ). Functionality looks similar to what we have with apt.
        Hide
        Joerg Schaible added a comment -

        Actually the Markdown format is inconsistently handled compared to apt. For Apt the main title is automatically subtracted from the first main header. With Mardown a main title is 1:1 rendered as h1 element and it is not taken as page title. A 2nd level title in markdown is rendered as h2 element instead of a section.

        Show
        Joerg Schaible added a comment - Actually the Markdown format is inconsistently handled compared to apt. For Apt the main title is automatically subtracted from the first main header. With Mardown a main title is 1:1 rendered as h1 element and it is not taken as page title. A 2nd level title in markdown is rendered as h2 element instead of a section.
        Hide
        Steve Moyer added a comment -

        I'm working towards fixing this issue as well as how anchors are created - these two areas must currently be addressed using XHTML within the markdown documents. Here's my plan:

        Does this sound sane?

        Show
        Steve Moyer added a comment - I'm working towards fixing this issue as well as how anchors are created - these two areas must currently be addressed using XHTML within the markdown documents. Here's my plan: Update pegdown ( https://github.com/sirthias/pegdown ) to process MultiMarkdown style metadata ( https://github.com/fletcher/MultiMarkdown/wiki/MultiMarkdown-Syntax-Guide#metadata - note that the link above references this page). Update pegdown to process MultiMarkdown style "Automatic Cross References" (e.g. in page links or anchors - https://github.com/fletcher/MultiMarkdown/wiki/MultiMarkdown-Syntax-Guide#automatic-cross-references ) Update the doxia markdown processor to add the (appropriate) metadata to the generated <html><head> (such as title, keywords, etc) Update the doxia page generator to concatenate the project name to the page name for the page's generated title block Does this sound sane?
        Hide
        Joerg Schaible added a comment -

        Perfect

        Show
        Joerg Schaible added a comment - Perfect
        Hide
        Steve Moyer added a comment -

        If someone wants to assign it to me, I'll update the issue as work is completed (note that I've got to get the changes to pegdown merged first, so this process will take a bit more time)

        Show
        Steve Moyer added a comment - If someone wants to assign it to me, I'll update the issue as work is completed (note that I've got to get the changes to pegdown merged first, so this process will take a bit more time)
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        provide a patch or a pull request ?

        Show
        Olivier Lamy (*$^¨%`£) added a comment - provide a patch or a pull request ?
        Hide
        Steve Moyer added a comment -

        Sure

        Show
        Steve Moyer added a comment - Sure
        Hide
        Hendrik Schreiber added a comment -

        Is there any progress on this issue?
        I would really appreciate not having to pollute my neat Markdown with ugly HTML headers...

        Show
        Hendrik Schreiber added a comment - Is there any progress on this issue? I would really appreciate not having to pollute my neat Markdown with ugly HTML headers...
        Hide
        Stephen Connolly added a comment -

        r1539350

        Show
        Stephen Connolly added a comment - r1539350
        Hide
        Hendrik Schreiber added a comment -

        Browsing the source via browser seems to be broken.
        => https://jira.codehaus.org/browse/DOXIA#selectedTab=com.atlassian.jirafisheyeplugin%3Afisheye-projectpanel

        May I ask, how you fixed this? Is the first encountered Markdown headline turned into the title?
        Does the Markdown header have to be of a certain level?

        Thanks!

        Show
        Hendrik Schreiber added a comment - Browsing the source via browser seems to be broken. => https://jira.codehaus.org/browse/DOXIA#selectedTab=com.atlassian.jirafisheyeplugin%3Afisheye-projectpanel May I ask, how you fixed this? Is the first encountered Markdown headline turned into the title? Does the Markdown header have to be of a certain level? Thanks!
        Hide
        Stephen Connolly added a comment -

        I added support for multi markdown metadata parsing. You'll need a 1.5-SNAPSHOT to see

        Show
        Stephen Connolly added a comment - I added support for multi markdown metadata parsing. You'll need a 1.5-SNAPSHOT to see
        Hide
        Hendrik Schreiber added a comment -

        Cool. I'll check it out.

        Show
        Hendrik Schreiber added a comment - Cool. I'll check it out.
        Hide
        Volker Voßkämper added a comment -

        I am using doxia and markdown as part of the Maven site generation capabilities.
        I tried now with 1.5-SNAPSHOT
        The Page Title is not set whith a heading.

        Show
        Volker Voßkämper added a comment - I am using doxia and markdown as part of the Maven site generation capabilities. I tried now with 1.5-SNAPSHOT The Page Title is not set whith a heading.

          People

          • Assignee:
            Unassigned
            Reporter:
            Klaus Reimer
          • Votes:
            5 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development