-
I have a following HTML file: <!-- https://fs.blog/feynman-technique/ -->
<h1 class="entry-title entry-title-single">The Feynman Technique: Master the Art of Learning</h1>
<div class="entry-content entry-content-single">
<p>The Feynman Technique is the most effective method to unlock your potential and develop a deep understanding. </p>
<p><a href="https://fs.blog/intellectual-giants/richard-feynman/">Richard Feynman</a> was not only a Nobel laureate in Physics but also a master of demystifying complex topics. His key learning insight: complexity and jargon often mask a lack of understanding. </p>
<p>Feynman’s learning technique comprises four key steps:</p>
<ol>
<li>Select a concept to learn.</li>
<li>Teach it to a child.</li>
<li>Review and refine your understanding.</li>
<li>Organize your notes and revisit them regularly.</li>
</ol>
<p>...</p>
<div class="wp-block-image">
<figure class="aligncenter"><img fetchpriority="high" decoding="async" width="1920" height="1080" src="https://149664534.v2.pressablecdn.com/wp-content/uploads/2012/04/FeynmanTechnique.jpg" alt="" class="wp-image-43131" srcset="https://149664534.v2.pressablecdn.com/wp-content/uploads/2012/04/FeynmanTechnique-300x169.jpg 300w , https://149664534.v2.pressablecdn.com/wp-content/uploads/2012/04/FeynmanTechnique-768x432.jpg 768w , https://149664534.v2.pressablecdn.com/wp-content/uploads/2012/04/FeynmanTechnique-1024x576.jpg 1024w , https://149664534.v2.pressablecdn.com/wp-content/uploads/2012/04/FeynmanTechnique-1536x864.jpg 1536w , https://149664534.v2.pressablecdn.com/wp-content/uploads/2012/04/FeynmanTechnique.jpg 1920w " sizes="(max-width: 1920px) 100vw, 1920px" /></figure></div>
<figure class="wp-block-pullquote"><blockquote><p>The person who says he knows what he thinks but cannot express it usually does not know what he thinks.</p><cite>Mortimer Adler</cite></blockquote></figure>
<h2 class="wp-block-heading">Step 1: Select a concept to learn.</h2>
<p>...</p> Note the first line is a comment, which I want to preserve. I need to convert this file to Markdown and to have as clear Markdown markup as possible, but also to keep any HTML comments there. Here is what I tried: pandoc from.htm -o to.md -f html+raw_html -t markdown --wrap=none --lua-filter=remove-attr.lua function remove_attr (x)
if x.attr then
x.attr = pandoc.Attr()
return x
end
end
return {{Inline = remove_attr, Block = remove_attr}} But I'm not really happy with its ouput: `<!-- https://fs.blog/feynman-technique/ -->`{=html}
# The Feynman Technique: Master the Art of Learning
<div>
The Feynman Technique is the most effective method to unlock your potential and develop a deep understanding.
[Richard Feynman](https://fs.blog/intellectual-giants/richard-feynman/) was not only a Nobel laureate in Physics but also a master of demystifying complex topics. His key learning insight: complexity and jargon often mask a lack of understanding.
Feynman's learning technique comprises four key steps:
1. Select a concept to learn.
2. Teach it to a child.
3. Review and refine your understanding.
4. Organize your notes and revisit them regularly.
\...
<div>

</div>
<figure>
<blockquote>
<p>The person who says he knows what he thinks but cannot express it usually does not know what he thinks.</p>
<p><cite>Mortimer Adler</cite></p>
</blockquote>
</figure>
## Step 1: Select a concept to learn.
\...
</div> For example, I would prefer
over
Changing pandoc from.htm -o to.md -f html+raw_html -t gfm --wrap=none --lua-filter=remove-attr.lua How can I achieve better output? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
If you don't the As for the figure, there is currently no syntax in pandoc markdown for a figure that contains anything other than a single image. So we fall back to raw HTML. You can disable that too:
but then you won't get the HTML comment at all. So to get everything you want, you'll need to:
|
Beta Was this translation helpful? Give feedback.
-
Thanks! But isn't it simpler to use
# The Feynman Technique: Master the Art of Learning
The Feynman Technique is the most effective method to unlock your potential and develop a deep understanding.
[Richard Feynman](https://fs.blog/intellectual-giants/richard-feynman/) was not only a Nobel laureate in Physics but also a master of demystifying complex topics. His key learning insight: complexity and jargon often mask a lack of understanding.
Feynman’s learning technique comprises four key steps:
1. Select a concept to learn.
2. Teach it to a child.
3. Review and refine your understanding.
4. Organize your notes and revisit them regularly.
...

> The person who says he knows what he thinks but cannot express it usually does not know what he thinks.
>
> Mortimer Adler and to write a Lua filter that will preserve HTML comments? Or maybe it won't work because we don't have |
Beta Was this translation helpful? Give feedback.
-
Thanks! John, may I ask one another question about comments? According to the Pandoc's user guide, the default value of the
|
Beta Was this translation helpful? Give feedback.
-
The default is false, and the manual doesn't say otherwise. The section you link to is just showing equivalences between specifying options on the command line and in a defaults file. It says nothing about pandoc's built-in defaults. |
Beta Was this translation helpful? Give feedback.
If you don't the
{=html}
raw attributes, then just specify-t markdown-raw_attribute
.As for the figure, there is currently no syntax in pandoc markdown for a figure that contains anything other than a single image. So we fall back to raw HTML.
You can disable that too:
-t markdown-raw_attribute-raw_html
- and then you'll getbut then you won't get the HTML comment at all.
So to get everything you want, you'll need to:
-f markdown-raw_attribute