James Fowler wrote:
I've been using QuickBook to create Boost style docs for a recent project, and it's been quite helpful! I have run into a few issues, and worked out some tentative solutions, but since IANABoostExpert just yet any feedback (along the lines of "that looks good" or "yeah, but that will catastrophically implode when ...") would be appreciated.

IANABJamExpert, so I'll limit my answers to those questions I am familiar with.

Item #2:  List alignment

I ran into a problem with alignment on unordered lists. The following source

    *foo1
     *bar1
      *baz1
    *foo2 this doesn't, foo2 is indented at bar1's level

produces the following output (hope you're email reader likes html...)

    * foo1
          o bar1
                + baz1
          o foo2 this doesn't, foo2 is indented at bar1's level

Indeed a but. I'll check this problem. Thanks for spotting this.

Any idea if this is QuickBook issue, or something deeper (like, in BoostBook or DocBook... I really don't want to go there....)

I think this is a QuickBook problem.

Item #3) Links to section id

Anchors are automatically created for each header within a section, such that given

    [section:my_section My Section]
    [h2 Header 1]
    some text

    [endsect]

I can create a link from another section in my qbk file using [link my_section.header_1 see My Section Header 1]. However, what I would like (I think) is to be able to create a link to the "top" of the section, something like [link my_section My Section]. Ideally, if I just used [link my_section] it would default the text for the link to the section title instead of the id ("My Section" instead of "my_section"). Is there currently any way to link to just the section_id (without having to add a header)?

No way yet. That's an oversight.

I was able to get part of the way by inserting
phrase << "<anchor id=\"" << section_id << ".top\" />\n";
at the end of begin_section_action::operator() in $BOOST/tools/quickbook/detail/actions.hpp (line 881), which lets me write [link my_section.top], although it doesn't ...

Good, first step.

anyhow, an hour or so just went by - that got me curious and I ended up modifying the title output in begin_section_action::operator()
phrase << "\n<title id=\"" << library_id << "." << section_id << ".title\">";
and adding

ok...

        struct sectionref_action
        {
            // Handles link to top of section

            sectionref_action(std::ostream& phrase, std::string& library_id)
            : phrase(phrase), library_id(library_id) {}

            template <typename Iterator>
            void operator()(Iterator first, Iterator last) const
            {
                Iterator save = first;
                phrase << "<link linkend=\"";
                while (first != last)
                    detail::print_char(*first++, phrase);
                phrase << ".top\" endterm=\"" << library_id << ".";
                first = save;
                while (first != last)
                    detail::print_char(*first++, phrase);
                phrase << ".title\" >";
            }

            std::ostream& phrase;
            std::string& library_id;
        };

now, we're hackin :)

(along with the requisite bits to hook it in, mimicking "link") which seems to do what I wanted. Now I can just say [sectionref my_section] and the result is a link to the top of section my_section with the text "My Section". Does this seem like the right way to do what I wanted (and was what I wanted reasonable in the first place)?

Yes, I think so. Please submit a full patch for the code and the docs. I can evaluate the patch in more detail. It's ok, AFAICT.

Regards,
--
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Boost-docs mailing list
[email protected]
Unsubscribe and other administrative requests: 
https://lists.sourceforge.net/lists/listinfo/boost-docs

Reply via email to