Comments (4)
Correct me if I got your requirement wrong.
You want to render the annotations as well in the toggle summary ?
from notion-to-md.
IMHO the toggle summary should be treated like any other paragraph and be rendered fully with annotations indeed, links, etc. The difficulty lies in keeping a functional Markdown output along with HTML tags required to produce the toggle, right ?
from notion-to-md.
True, maybe I should treat toggle as paragraph, but I'm sure it's going to break a lot of websites using this package. Any preferred format you have in mind?
I tried using setCustomTransformer
like so:
n2m.setCustomTransformer("toggle", async (block) => {
const { toggle } = block as any;
// console.log(toggle);
let toggle_text = "";
toggle.rich_text.forEach((rich_text: any) => {
toggle_text += n2m.annotatePlainText(
rich_text.plain_text,
rich_text.annotations
);
});
return toggle_text;
});
output:
This is a <u>~~**toggle**~~</u>
however this won't deal with the toggle children.
from notion-to-md.
Directly producing HTML is not this package's purpose
but outputtingandis probably the only way this can be done.
Remember HTML is also supported in markdown docs :)
from notion-to-md.
Related Issues (20)
- Can I get color info from notion?
- Notion has changed `link_to_page` to `mention` for @ links HOT 1
- Quotes with extra content
- Can you turn this into an N8N node? HOT 1
- Keep errors uncaught HOT 3
- fs dependency issues HOT 2
- Why make breaking changes in minor versions ?????? Why HOT 1
- Improvement: Use string union for Block Type instead of string HOT 8
- Question: example "notion-to-md" repositories? HOT 6
- support notion database HOT 4
- 'undefined' in the last line of table markdown string HOT 6
- Can you turn of loading child pages entirley? HOT 4
- missing/insufficient newlines after <details> tags HOT 1
- Commit to semantic versioning? HOT 1
- Wrong typings - CustomTransformer? HOT 3
- Significant Performance Improvement in Markdown Conversion Process HOT 1
- blocksToMarkdown() drops sublist items in a column HOT 2
- Feature Request: link previews HOT 1
- Children blocks with custom transformers are not included in the output of blocksToMarkdown HOT 2
- How does this compare to the export to markdown option in Notion? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notion-to-md.