Skip to content

Support task Element#345

Closed
ghost wants to merge 8 commits intodevelopfrom
feature/task
Closed

Support task Element#345
ghost wants to merge 8 commits intodevelopfrom
feature/task

Conversation

@ghost
Copy link

@ghost ghost commented Sep 22, 2017

PR, mainly for the purposes of reviewing this... There must be some reason why you named the commits "first draft", I guess.

TODO:
* CSS rules need to be improved, but the structure should be there
* Language files; currently only "en" is supported for a proof of
  concept
TODO:
* spaces between the (automated) title taskprerequisites and taskrelated
  needs to be adapted
Copy link
Author

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. so mostly, stuff comes out as it should but there is still lots of positioning issues related to the headlines of "tasksummary" and "taskprerequisites". can you try position these similarly to normal preambles in fo? also, in fo, there is a huge gap after the tasksummary, that really needs fixed. (i can take care of the css for html.)

  2. why does taskrelated not get a headline in html but does get one in fo? curiously, tasksummary does not get a headline in fo but does get one in html.

  3. i have a question that relates to geekodoc: why is it not allowed put itemizedlists in taskprerequisites? lists seem a natural fit for prereqs, no?

<l:gentext key="step.optional" text="(Optional)"/>

<l:gentext key="tasksummary" text="Summary"/>
<l:gentext key="taskprerequisites" text="Requirements"/>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, looking at https://github.com/docbook/xslt10-stylesheets/blob/master/gentext/locale/en.xml#L350 , I wonder: are the tasksummary/taskprerequisite/taskrelated elements supposed to have actual titles instead of something autogenerated? does geekodoc allow titles for these elements?

also, (stating the obvious)make sure to add some more languages...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder: are the tasksummary/taskprerequisite/taskrelated elements supposed to have actual titles instead of something autogenerated? Does geekodoc allow titles for these elements?

Currently, no title inside of these task* elements are allowed in Geekodoc. So yes, that's a feature and not a bug. 😉

Sure, we could allow titles, but I think in that case we would only get further inconsistencies which would "weaken" our task appearance. At the moment, I can't think of a use case where a title in these task* elements is absolutely necessary.

To summarize it, I would like to keep it that way for the time being. Let our writers gain some experiences. If we think we need it, we can add titles in a later version without any compatibility problems.

.itemizedlist-title .link, .variablelist-title .link, .qandadiv-title .link,
.title .ulink, .subtitle .ulink, .table-title .ulink, .example-title .ulink,
.figure-title .ulink, .procedure-title .ulink, .orderedlist-title .ulink,
.figure-title .ulink, .procedure-title .ulink, .task-title .ulink, .orderedlist-title .ulink,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh my. i can't even look at this css. totally not your fault but mine. but i almost feel like opening a bug about generating fewer of those class names.

to be clear: your changes are fine and should work. this is more of a note-to-past-self.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. 👍

</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use two spaces for indentation please. (it seems you're switching between one and two occasionally.)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arhg, I was too inconsistent. Could we do it later? Or what procedure do you prefer to change this?


<xsl:template match="tasksummary|taskprerequisites">
<div class="{local-name(.)}">
<h6 class="{local-name(.)}-title">
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could hardcode task-title here instead, otherwise you'll have to add lots of extra css to style these extra titles.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, did that.


.procedure-title-wrap + .procedure-contents {
.procedure-title-wrap + .procedure-contents,
.task-title-wrap + .task-contents {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to this line, but could find a good place for

.task-contents .procedure-contents {
  border-left: none;
}

That'll remove the extra line still displayed at the side.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, see commit 391f98d

Stefan Knorr and others added 4 commits September 22, 2017 19:44
Suggested by sknorr, thanks!
This should fix the missing taskrelated title
* Add missing rules for .task-title-wrap, .taskprerequisites and
  .tasksummary
* Add rule for .task-contents and its first p child
* Add missing .task-contents > * rule to adjust left positioning
@tomschr
Copy link
Collaborator

tomschr commented Sep 25, 2017

[...] still lots of positioning issues related to the headlines of "tasksummary" and "taskprerequisites".

I tried to fix them in the CSS, and it looks ok-ish. However, I guess, I did more harm than good. You should review my changes carefully. See commit f4a7b79.

why does taskrelated not get a headline in html but does get one in fo? curiously, tasksummary does not get a headline in fo but does get one in html.

This should be fixed now in commit 7fcde21, there was an inconsistency in our HTML templates for the task* elements.

i have a question that relates to geekodoc: why is it not allowed put itemizedlists in taskprerequisites? lists seem a natural fit for prereqs, no?

According to comment openSUSE/geekodoc#1 (comment) we discussed this and we came up with no lists. I can't remember why, but I guess, it is an omission.

I've opened openSUSE/geekodoc#25.


Apart from the issues above, I found another problem in HTML (and probably in FO, too):

  • If you don't add a procedure title, there is no clear distinction between the content of a taskprerequisites and the following procedure. It looks like, the procedure belongs to the previous element, which is not really the case.

  • If you add a procedure title, the "Procedure x.y" text is rendered gray, whereas the title itself is in green. It looks a bit odd, but for the time we can keep it.

I'm not sure how to solve it, but I could think of the following solutions when the author doesn't add a procedure title:

  1. Add a line.
    Probably not the best idea, but it would work.
  2. Add "Procedure x.y"
    I would prefer this if we don't find a better solution
  3. Moar space?
  4. Something else?

Change task.children.title.spacing and include only space-before.*
attributes
</info>

<chapter xml:id="cha.procedure">
<title>Procedures</title>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, did I accidentally put the test case stuff into the same commit here on Friday? If so, that was not intended...

@tomschr tomschr changed the title Feature/task Support task Element Sep 28, 2017
@ghost ghost force-pushed the feature/task branch from 27d4928 to a7fa6ed Compare October 16, 2017 14:34
@ghost ghost closed this Nov 29, 2019
@ghost ghost mentioned this pull request Nov 29, 2019
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant