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

Allow continuing list from a certain index #199

Open
raducoravu opened this issue Nov 8, 2023 · 3 comments
Open

Allow continuing list from a certain index #199

raducoravu opened this issue Nov 8, 2023 · 3 comments

Comments

@raducoravu
Copy link
Collaborator

I have this Markdown content:

# Title

1. A
2. B

```plain
hello
```

3. Some content
4. Other content

If I were to convert it to HTML, the result HTML would look like this:

<h1>Title</h1>
<ol>
<li>A</li>
<li>B</li>
</ol>
<pre><code class="language-plain">hello
</code></pre>
<ol start="3">
<li>Some content</li>
<li>Other content</li>
</ol>

so two lists with a pre in between, the second list starts from 3.
The conversion to DITA looks like this:

    <ol>
        <li>A</li>
        <li>B</li>
    </ol>
    <codeblock xml:space="preserve" outputclass="plain">hello</codeblock>
    <ol>
        <li>Some content</li>
        <li>Other content</li>
    </ol>

Maybe we could add some kind of outputclass value on the second ol to state that it should start from a certain index, in this way the publishing could be customized to reflect this. Otherwise the information about the initial counter state for the second list is lost in the DITA XML content.

@jelovirt
Copy link
Owner

The biggest problem for me is that it would not map to standard DITA. So it would not be just configuring how Markdown structures are mapped to DITA structures, it would be extending DITA. I see @outputclass as an extension, because it's not compatible with other DITA tools anymore. For example, does Oxygen support some magic @outputclass value that effectively works like HTML5 @start?

It should probably be something like

<ol outputclass="start-3">

@raducoravu
Copy link
Collaborator Author

The biggest problem for me is that it would not map to standard DITA. 

Agreed, but there is also a problem if semantic meaning is lost in the conversion.

    I see @outputclass as an extension, because it's not compatible with other DITA tools anymore. 

So do I. Probably one of the most useful attributes though :)

For example, does Oxygen support some magic @outputclass value that effectively works like HTML5 @start?

No, but we were pondering about adding one.

 <ol outputclass="start-3">

Looks good.

@michael-nok
Copy link

Your Markdown format is invalid for the ordered list numbering to continue.

To ensure your codeblock (or any content) is considered part of 2. it must be indented using 4 spaces

# Title

1. A
2. B

    ```plain
    hello
    ```

3. Some content
4. Other content

Markdown syntax allows for auto-number generation, so you should consider using the one format (re: MD029)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants