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

Make headers in help hover look prettier #392

Merged

Conversation

ManuelHentschel
Copy link
Member

Modifies the header of help hovers to remove the first line.
Information about the package is moved to the first proper header instead.

@renkun-ken
Copy link
Member

The title might not look better than before if it is long.

image

@renkun-ken
Copy link
Member

What about using

pattern <- "<table.*?<td>(.*?)\\s+{(.*?)}<\\/td>.*?<\\/table>\\n*"
replacement <- "<b>\\1</b> <i>{\\2}</i><hr/>"

image

Both topic and package are preserved in the headline of the hover.

@ManuelHentschel
Copy link
Member Author

What about using

pattern <- "<table.*?<td>(.*?)\\s+{(.*?)}<\\/td>.*?<\\/table>\\n*"
replacement <- "<b>\\1</b> <i>{\\2}</i><hr/>"

That looks quite nice as well. What bothers me a bit here (and in the original version) is the vertical space taken up by the large heading plus the line "Encoding {base}", which I tried to reduce by moving the package info into the heading.

What do you think about these?

replacement <- "<b>\\1</b> <i>{\\2}</i><br/>\\3<hr/>"
pattern <- "<table.*?<td>(.*?)\\s*{(.*?)}<\\/td>.*?<\\/table>\\n*<h2>\\s*(.*?)\\s*<\\/h2>"

image

@renkun-ken
Copy link
Member

What do you think about these?

It looks good! Let's use this one.

R/workspace.R Outdated Show resolved Hide resolved
Copy link
Member

@renkun-ken renkun-ken left a comment

Choose a reason for hiding this comment

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

LGTM

@ManuelHentschel ManuelHentschel merged commit f3ee95e into REditorSupport:master Mar 17, 2021
@ManuelHentschel ManuelHentschel deleted the prettierHeaders branch March 17, 2021 20:10
@renkun-ken
Copy link
Member

Just noticed that pandoc < 2.0 will produce different result with the modified html:

image

Let me do a quick fix for this.

@renkun-ken
Copy link
Member

renkun-ken commented Mar 18, 2021

pandoc >= 2.0

**get** *{base}*  \nReturn the Value of a Named Object\n\n-----\n\n

pandoc < 2.0

**get** *{base}*\nReturn the Value of a Named Object\n\n------------------------------------------------------------------------\n\n

Looks llike <br/> is not translated to <space><space>\n.

@renkun-ken
Copy link
Member

Fixed via 62b06e5.

replacement <- "<b>\\1</b> <i>{\\2}</i><p>\\3</p><hr/>"

image

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.

None yet

2 participants