Comments (8)
shouldn't each note be processed only once?
The current implementation is somewhat naive in that regard.
This function is responsible for parsing an Obsidian Markdown file:
Line 243 in 7027290
If this encounters the ![[embed]]
syntax, it calls embed_file
:
Lines 301 to 303 in 7027290
embed_file
, in turns, calls the parse_obsidian_note
function from above again if it encounters another Markdown file:
Line 341 in 7027290
This is what allows a loop to be created.
However, I'm already passing through a context struct to hold information about the note that is being processed:
Lines 90 to 97 in 7027290
Technically, I would be able to keep track of all files that we've processed up to the root note, which would allow implementing the exact behavior you mention (skip a note if it's already been processed). I may play around with that and implement this (possibly as an optional mode) somewhere over the next couple of weeks. Stay tuned 😄
from obsidian-export.
Hey there @cristianvasquez!
To make sure I understand correctly:
- You have a note
Transcluding.md
- This note includes itself (it contains
![[Transcluding]]
) - You run into the
Recursion limit exceeded
error when trying to export a vault with this note.
Is that correct? If so, this is by design. A note which includes itself would otherwise lead to infinite recursion (which would eventually cause the program to abort with a panic).
I'm not sure off-hand how Obsidian itself handles this (I think it embeds about 7 iframes and then just stops?) but I chose to make this an explicit error to make a note like this very obvious.
Would you prefer to see a different behavior here?
from obsidian-export.
I don't know what should be expected. But this behavior forced me to change my notes, otherwise, I cannot export.
This happens if there is any 'closed circuit' in notes that expand.
By the way, why it expands the notes?
from obsidian-export.
Perhaps some sort of .gitignore but for the export would allow ignoring,
Or a fail silently option?
from obsidian-export.
This happens if there is any 'closed circuit' in notes that expand.
By this, do you mean note A which transcludes note B, where note B in turn transcludes note A again?
By the way, why it expands the notes?
I'm afraid I don't understand this question, could you elaborate?
Perhaps some sort of .gitignore but for the export would allow ignoring,
This is already supported, see https://github.com/zoni/obsidian-export#ignoring-files 😄
Or a fail silently option?
I think I'd like to understand the use-case slightly better before adding functionality, but I wouldn't be opposed to implementing something like that.
from obsidian-export.
Oh!... the ignore option was what I looked for :)
Regarding the question, I still don't get why a Recursion limit happened :) shouldn't each note be processed only once?
from obsidian-export.
Hey @cristianvasquez, happy new year. 😃
I've just published v0.5.0 which includes a new option, --no-recursive-embeds
, to skip processing files more than once within the same note. I believe this will give you the behavior you were looking for.
from obsidian-export.
happy new year to you @zoni ! Thanks for the new option :)
from obsidian-export.
Related Issues (20)
- Adding option for angle bracket escaping over url-encoding HOT 1
- Add canvas export support
- feature request: add a flag to specify path prefix for wikilinks HOT 1
- Allow us to strip date from link generated
- Builds fail due to linting error HOT 3
- preserve mtime of source file
- Include titles
- Can't export to pdf with typst, unrecongnized subcommand HOT 1
- Why the restriction on symlinked folders?
- [Feature Request] Create tag to partially ignore content within a file. HOT 2
- Warning: Unable to find referenced note, is too verbose.
- Export only labeled files HOT 3
- Angular brackets incorrectly escaped in embedded Latex
- Postprocessor type does not enable storing state in the postprocessor
- Warning: Unable to find embedded note Reference: 'xxx' HOT 1
- Wikilinks filename followed by space not linked properly HOT 1
- Feature Request: continue even if error HOT 2
- Embedded link blocks don't work properly HOT 2
- Allow specifying directory relative to root for `--start-at`
- Flag for export only nesessary attachements 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 obsidian-export.