Coder Social home page Coder Social logo

highlight boxes about rtutor HOT 5 OPEN

skranz avatar skranz commented on May 9, 2024
highlight boxes

from rtutor.

Comments (5)

skranz avatar skranz commented on May 9, 2024

The highlight boxes look very nice. Thanks for the update. Maybe one suggestion. Perhaps instead of defining styles by a shortened name, like

<style>
.highlight_base_Youshouldknow {
    background-color: #88FF8F;
    padding: 0 2em 1em;
    margin: 2.5em 2.5em 2.5em 2.5em;
}
</style>

perhaps it may make more sense to have a style_class argument, like

#< highlight style_class="mystyle"

and then define CSS styles like

<style>
.highlight_base_mystyle {
    background-color: #88FF8F;
    padding: 0 2em 1em;
    margin: 2.5em 2.5em 2.5em 2.5em;
}
</style>

So you can easily use different forms of highlights, like warnings, remarks, etc...

from rtutor.

skranz avatar skranz commented on May 9, 2024

Another remark:
I have updated the automatic hint for dplyr chains (mostly relevant if there are still placeholders ___), which looked very ugly so far:
d727b11

I now also set show.revert.btn=TRUE by default in show.ps:
f1a9446

There still seems to be sometimes as bug that the given code vanishes in the shiny version, when RTutor automatically jumps to edit the next chunk when the previous chunk was successfully checked. Have you also observed this behavior? I had not yet time to dig deeper into it. Such bugs at only appear sometimes are always tricky to debug. But at least with the "Original Code" button users can always retrieve the originally given code, should that bug occur.

from rtutor.

MartinKies avatar MartinKies commented on May 9, 2024

Thank you for your suggestion! I still opted for the named block as the default case as I want it to make it as easy as possible for the author to write content without having to think about design.

Nevertheless it is now possible to completely seperate content and style, which might be useful in some instances: https://leveragedata.shinyapps.io/HighlightExample/

We do indeed use different forms of highlights (in particular Attentions and Remarks) but those always have the same title within their class (i.e. I want to have always the same design for all Attention Blocks). With the class feature it is now possible to have seperate groups of designs within the same title-group.

It also allows to have varying titles with the same design which was not a use case I previously thought about, as I currently only use strictly defined groups in my courses.

Regarding the other points:

Thank you for your info regarding the dplyr hints and the show.revert.button. I have both integrated.

Yes, we also experience this bug - and have unfortunately currently no good lead regarding its source. If you fix it, a note would be nice. Should we stumble upon the solution, we will open a new issue.

Regarding future development of our fork: Most of the previous changes where aimed at reducing time and complexity of the author(s) (The Highlight Boxes for example where previously achieved by using html hax and the aftercare shiny -> html script by manual processes). I think the most pressing issues are now resolved.

Maybe I will introduce an tag which can be used within html blocks to allow rmd formatting within a html block. This is relevant if for example one has formatted html-tables (instead of rmd-tables) and wants for example to use Math-Syntax within a cell. This is currently rather inconvenient as rmd-code does not get interpreted within html tags and manual MathJax is not very authorfriendly.

The next big thing will most likely be a complete extraction of all user-sided texts and putting them in a language file for roll-out in different languages (e.g. German but also to allow course-specific Texts independent of the specific task).

from rtutor.

skranz avatar skranz commented on May 9, 2024

Just some short thoughts on your comment:

Maybe I will introduce an tag which can be used within html blocks to allow rmd formatting within a html block. This is relevant if for example one has formatted html-tables (instead of rmd-tables) and wants for example to use Math-Syntax within a cell. This is currently rather inconvenient as rmd-code does not get interpreted within html tags and manual MathJax is not very authorfriendly.

Hmm, not sure whether writing something like

<table><tr><td>
#< md
$x^2$
#>
</td></tr></table>

is more convenient than the pure HTML solution

<table><tr><td>
\(x^2\)
</td></tr></table>

Perhaps, if you don't want to teach your co-workers a bit HTML, it might be more convenient to define an outer block, like #< md_html so that all HTML text inside will be rendered as markdown. But it is not clear to me how easy that is to implement. This discussion may help (you could use commonmark for rendering such blocks):

https://stackoverflow.com/questions/29368902/how-can-i-wrap-my-markdown-in-an-html-div

Alternatively, you use some rvest & htmltools function to acces the text attributes of all html elements and run a markdown converter on them.

from rtutor.

MartinKies avatar MartinKies commented on May 9, 2024

Thank you for your input! I did not know this command - this is a lot more elegant than what I did until now. I suppose stuff like emphasize and bolding etc. is not to difficult so when the Math Stuff ist taken care of this certainly lowers this issue a lot in the priority list.

from rtutor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.