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

WikiLink Embedding - ![[..]] #24

Open
8 of 11 tasks
srid opened this issue May 24, 2021 · 7 comments
Open
8 of 11 tasks

WikiLink Embedding - ![[..]] #24

srid opened this issue May 24, 2021 · 7 comments
Assignees
Labels
enhancement New feature or request Research Requires some thinking on how to approach this

Comments

@srid
Copy link
Owner

srid commented May 24, 2021

Support for https://help.obsidian.md/How+to/Embed+files

@srid srid added enhancement New feature or request Research Requires some thinking on how to approach this labels May 24, 2021
@srid srid pinned this issue Jun 4, 2021
srid added a commit that referenced this issue Jun 4, 2021
@srid srid changed the title Embedding - ![[..]] Wikilink Embedding - ![[..]] Jun 20, 2021
@srid srid changed the title Wikilink Embedding - ![[..]] WikiLink Embedding - ![[..]] Jun 20, 2021
@srid srid self-assigned this Jun 27, 2021
@vcavallo
Copy link

vcavallo commented Jul 22, 2021

I propose adding an item to the checklist above:

  • Allow embedding a specific subset block of a file.

For instance, the ## Some Section H2 heading and all text until next section. Obsidian's syntax is basically: ![[filename#Some Section]]

Obsidian supports this and it would be great to have parity between Obsidian editing and Emanote's rendered results.

@kukimik
Copy link
Contributor

kukimik commented Nov 8, 2021

Embedding notes may create loops:

some_note.md:

blah

![[other_note]]

blah

other_note.md:

aaa

![[some_note]]

bbb

I've tried it with the live preview and couldn't open any of these notes in browser. Didn't have time to check memory/CPU usage etc., but perhaps the loops should be detected anyway?

@srid srid unpinned this issue Mar 13, 2022
@srid
Copy link
Owner Author

srid commented Oct 9, 2022

@vcavallo Yes, we need to address it in a fundamental manner first: #105

@kukimik Could you open a new issue?

@srid
Copy link
Owner Author

srid commented Oct 9, 2022

I think we should also support source code embedding. For eg., ![[foo.hs]] should include that as syntax highlighted code block. See also srid/neuron#613 (not sure how that can be adopted for wiki links)

@kukimik
Copy link
Contributor

kukimik commented Oct 11, 2022

@kukimik Could you open a new issue?

With the current version of emanote I can display the page. It looks like this:

Peek 2022-10-11 22-10

It no longer loops indefinitely. (Or maybe it never did? I upgraded my hardware in the meantime; maybe I was just lacking resources - which however would mean the resource consumption was excessive.)

So I can open an issue, but I don't treat the current behavior as a bug/problem.

@bolt12
Copy link
Contributor

bolt12 commented Jun 1, 2023

I am working on adding code files embedding support. I decided to hijack this post to ask if anyone knows a good way to solve this challenge I am facing:

The embed template itself. I realized I am not familiar with the way code blocks get rendered in HTML. I have inspected the source code and apparently they get transformed into <code> tags. The content of the code block then gets highlighted by using <span> of a specific class attribute so it gets properly highlighted (via highlight.js). The challenge then, is to take the code file content and embed it correctly in a <code> tag.

Does anyone more familiar or knowledgeable can see a way to do this?

Edit: I think I am on the right track. I figured I could just redundantly call hljs.highlighAll();.

shivaraj-bh pushed a commit to shivaraj-bh/emanote that referenced this issue Dec 18, 2023
@dpaetzel
Copy link

dpaetzel commented Jul 2, 2024

I know this issue has not seen activity in quite some time but I'd like to add another feature request: I'd like to be able to embed a file FILE without FILE's heading being generated. This would be very handy for having FILE contain a lot of \newcommand{…} definitions; I could then simply include it using ![[FILE|noheading]] (or whatever syntax is used) whenever I want to write math without cluttering the output. Note that simply not setting a title within FILE does not work because HTML output then has FILE as title.

Note that doing ![[FILE]] works in terms of math \newcommand's being parsed in the importing file (but an empty block with a is generated). Example:

Test.md

# Test

![[FILE]]

$$
\XX
$$

FILE.md

$$
\newcommand{\XX}{\mathcal{X}}
$$

Output when opening Test in browser:

image

What I'd like to see:

image

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

No branches or pull requests

5 participants