-
Notifications
You must be signed in to change notification settings - Fork 20
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
using org special block extras with tufte #20
Comments
When you do the above, you're not longer using
Could you please explain what you mean by "it doesn't [work] with Some minimal examples along with screenshots of the rendered HTML with and |
I'll include some screenshots. Here is what I did:
So, (if all is well), you can see an exercise environment that is green. And, in the page you can click on the solution, to see the solution :-) BTW, my present website (which runs on nikola but that I want to port to pure org mode) contains several examples: https://ndvanforeest.github.io/posts/one-cookie/ This works all very well for the exercises, but the sidenotes go wrong. Now I run the same things as above, but with the org-tufte-publish-to-html as provided by ox-tufte. This gives the screenshot: Hopefully this suffices to explain the problem. Thanks for all your help. |
Thank you for the details. I think I'm starting to understand what's going on. With the Org mode file you shared we're almost at a minimal example that I can Test result with
|
I ran your code with 'html, and the result is indeed quite different from
yours:
"<p>
PRE
</p>
<div class=\"exercise\" id=\"org45b0e09\">
<p>
QUESTION
</p>
<details class=\"code-details\"
style =\"padding: 1em;
background-color: #e5f5e5;
border-radius: 15px;
color: hsl(157 75%);
font-size: 0.9em;
box-shadow: 0.05em 0.1em 5px 0.01em #00000057;\">
<summary>
<strong>
<font face=\"Courier\" size=\"3\" color=\"green\">
Solution
</font>
</strong>
</summary>
<div style=\"padding: 1em;background-color: #CCFFFF;border-radius:
15px;font-size: 0.9em;\"> <h3>Did you actually try? Maybe see the ‘hints’
above!</h3>
<details class=\"code-details\"
style =\"padding: 1em;
background-color: #e5f5e5;
border-radius: 15px;
color: hsl(157 75%);
font-size: 0.9em;
box-shadow: 0.05em 0.1em 5px 0.01em #00000057;\">
<summary>
<strong>
<font face=\"Courier\" size=\"3\" color=\"red\">
Solution, for real
</font>
</strong>
</summary>
<p>
SOLUTION
</p>
</details>
</div>
</details>
</div>
<p>
POST</p>
"
The org-special-block-extras package contains a solution environment, and
this contains the strings "Did you actually try":
http://alhassy.com/org-special-block-extras/#Short_Example_An_opportunity_to_learn
When I run your code with 'tutfe-html I get precisely the same answer as
you do.
…On Sun, 7 Jan 2024 at 22:14, suhail-singh ***@***.***> wrote:
Thank you for the detail. I think I'm starting to understand what's going
on.
org-special-block-extras as the name suggests does some special handling
of
"special blocks" <https://orgmode.org/worg/org-syntax.html#Greater_Blocks>
.
With the Org mode file you shared we're almost at a minimal example that I
can
use to better understand what's going on. Hopefully with your (further)
help
I'm able get a deterministic test.
Test result with ox-html
On my setup without org-special-block-extras installed, evaluating the
below
Elisp code:
(org-export-string-as "PRE#+begin_exerciseQUESTION#+begin_solutionSOLUTION#+end_solution#+end_exercisePOST" 'html t)
Results in:
"<p>
PRE
</p>
<div class=\"exercise\" id=\"orgb7dafd5\">
<p>
QUESTION
</p>
<div class=\"solution\" id=\"org16ff343\">
<p>
SOLUTION
</p>
</div>
</div>
<p>
POST</p>
"
Test result with ox-tufte
With ox-tufte, evaluating below
(org-export-string-as "PRE#+begin_exerciseQUESTION#+begin_solutionSOLUTION#+end_solution#+end_exercisePOST" 'tufte-html t)
results in:
"<p>
PRE
</p>
<div class=\"exercise\" id=\"orgdc49136\">
<p>
QUESTION
</p>
<div class=\"solution\" id=\"org970f65b\">
<p>
SOLUTION
</p>
</div>
</div>
<p>
POST</p>
"
Help needed: Test result with ox-html when using org-special-block-extras
Could you please share the result of evaluating the below Elisp code when
org-special-block-extras is in use?
(org-export-string-as "PRE#+begin_exerciseQUESTION#+begin_solutionSOLUTION#+end_solution#+end_exercisePOST" 'html t)
—
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAM266PBNUO2FAKY3GHHLKTYNMF2ZAVCNFSM6AAAAABBPUBMOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBQGE3TINJZGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Thank you for that. It's clear that Looking at the code for It's not clear to me that the above change alone would be sufficient to address Have you tried reaching out to the author/maintainer of |
Ok. No, I have not contacted the author of org-special-block-extra, but
surely I can do that. However, I don't need most of the fancy stuff that
the -extras package offers. Perhaps I can just as well find a way to pass
in the html I need for my goals. I'll try.
…On Mon, 8 Jan 2024 at 10:16, suhail-singh ***@***.***> wrote:
Thank you for that. It's clear that org-special-block-extras is doing some
additional things when the export backend is 'html.
Looking at the code for org-special-block-extras.el
<https://github.com/alhassy/org-special-block-extras/blob/master/org-special-block-extras.el>
,
I noticed a few occurrences of (equal backend 'html). At the very least
these
would need to be amended to something like
(org-export-derived-backend-p backend 'html) instead.
It's not clear to me that the above change alone would be sufficient to
address
matters, but it seems like it would be necessary. In any case the issue,
as far
as I understand it, seems to be in org-special-block-extras' handling of
its
"guards".
Have you tried reaching out to the author/maintainer of
org-special-block-extras?
—
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAM266OW36TFSWWYRODP3X3YNO2QPAVCNFSM6AAAAABBPUBMOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBQGYZDMMRXHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
You'll be able to get the necessary structure via an Org mode file that looks
Exporting the above via something like The CSS will likely need some tweaks, some of which (e.g., those relating to |
For some pages I use https://github.com/alhassy/org-special-block-extras. While this works out of the box with org-html-publish-to-html, it doesn't with org-tufte-publish-to-html. However, it suddenly does work if I replace 'tufte-html by 'html in
(defun` org-tufte-publish-to-html (plist filename pub-dir)
"Publish an org file to Tufte-styled HTML.
PLIST is the property list for the given project. FILENAME is
the filename of the Org file to be published. PUB-DIR is the
publishing directory.
Return output file name."
(ox-tufte--utils-entrypoint-funcall
filename
#'org-publish-org-to 'html filename ; HERE IS MY CHANGE
(ox-tufte--utils-get-export-output-extension plist)
plist pub-dir))
I admit that I don't uderstand why this change works.
The text was updated successfully, but these errors were encountered: