-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
DocBook writer: output identifiers of figure blocks #8608
base: main
Are you sure you want to change the base?
Conversation
Note: In contrast to the DocBook writer, the DocBook reader already supports the identifier. Behavior before the change:
Behavior after the change:
|
Docs for |
d23f6a8
to
9fa5e76
Compare
I’ve added the prefix. However, now I seriously wonder if the prefix is maybe also missing at other places in the DocBook writer. The following :::{#bar}
bar div
:::
:::{#sec .section}
sec div
:::
[foo link](#foo)
[span]{#spanid}
![caption text](file.svg){#testid} translates via <para xml:id="bar">
bar div
</para>
<para xml:id="sec">
sec div
</para>
<para>
<link linkend="prefix-foo">foo link</link>
</para>
<para>
<anchor xml:id="spanid" />span
</para>
<figure xml:id="prefix-testid">
<title>caption text</title>
<mediaobject>
<imageobject>
<imagedata fileref="file.svg" />
</imageobject>
<textobject><phrase>caption text</phrase></textobject>
</mediaobject>
</figure> Note that |
Hi, I'm sorry I let this languish so long. You're right that the prefix isn't added everywhere it should be. Perhaps that could be addressed in a separate PR. Or, feel free to address it here. I'll add one substantive comment to your code above. |
version <- ask | ||
let idAttr = [ (idName version, writerIdentifierPrefix opts <> id') | ||
| not (T.null id') ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have the idAndRole
function, and I think it would make sense to use it here (and anywhere else where we'd manually be constructing an id
attribute).
Note also that the idAndRole
function doesn't use the version-dependent idName
. That should be fixed.
It would also be great to have a test. Simplest way is a "command test" called |
@Reviewer: I am not sure if the id needs to be prefixed with
writerIdentifierPrefix opts
as done in line 190 (this is the only place where the prefix is added AFAICT).