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

Special formatting for cells with special tags #45

Closed
adowling2 opened this issue Jun 6, 2020 · 3 comments
Closed

Special formatting for cells with special tags #45

adowling2 opened this issue Jun 6, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@adowling2
Copy link
Collaborator

In my current CBE 20258 notebooks, I use some HTML code to put a colored box around certain markdown cells. For example:

<div style="background-color: rgba(0,255,0,0.05) ; padding: 10px; border: 1px solid darkgreen;"> 
<b>Home Activity</b>: In the cell below, assign the value of 5 to the variable x. Then type Shift+Enter to execute the line.
</div>

This box is solid dark green which I use for all "home activities". I used a blue box for "class activities" and a red box for "important notes". Would it be possible to add a border and set the background color accordingly for cells with "home-activity", "class-activity", and "important-note" tags when publishing to the HTML pages? Currently, nbpages strips out this formatting, which I think is fine. I would much rather use tags.

@adowling2 adowling2 changed the title Special processing for cells with special tags Special formatting for cells with special tags Jun 6, 2020
@adowling2 adowling2 added this to the Fall 2020 Session milestone Jun 6, 2020
@adowling2 adowling2 added the enhancement New feature or request label Jun 6, 2020
@jckantor
Copy link
Owner

jckantor commented Jun 6, 2020

Check out what I did on nbpages ... https://jckantor.github.io/nbpages/02.01-Tagging.html

The relevant code is entirely in /templates/notebook.tpl, so this is potentially a user configurablel feature. But currently there is no backup for the templates if --setup is rerun. So if this looks like a good idea, then that's a change needed for --setup in order to protect against inadvertently overwriting a modified template.

@jckantor
Copy link
Owner

jckantor commented Jun 6, 2020

Existing templates are now backed up prior to updating in --setup. This should protect against the inadvertent loss of edits to the template files.

@adowling2
Copy link
Collaborator Author

This is great! I am going to close the issue, although this is something we should eventually document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants