Code Monkey home page Code Monkey logo

admonitions's Introduction

🥇 Our documentation has moved here.

Buy Me a Coffee at ko-fi.com


Development Status: Maintenance Mode

Due to a glut of high priority Javalent plugin projects, this plugin is now entering maintenance mode for the time being. This is not a permanent status.

  • PR's will be reviewed.
  • Yay bugs will be reviewed and worked if able.
  • Feature Requests will not be worked.

The Admonition plugin for Obsidian is a tool that allows you to create attention-grabbing callouts, tips, warnings and other informative blocks within your notes. The plugin provides a range of pre-defined icons to pick from, as well as the ability to create your own custom styles using CSS. You can customize and style to fit your specific needs, and can target each iteration independently using the .callout and .admonition selectors.

Features

  • Supports a variety of built-in admonition types such as tip, warning, caution, note, and more.
  • Customizable styles with the ability to use Markdown attributes in callouts, or stylize directly with CSS.
  • Supports nesting of blockquotes and code-blocks.
  • Admonitions can flourish in combination with other plugins such as Obsidian Templates or @SilentVoid13's Templater.
  • Supports import and export of custom admonitions via .json files.

Quickstart

  1. Install the Admonition plugin from the Community Plugins pane in Obsidian.
  2. Callout Version: In the editor, type out the name of an admonition type (such as >[!tip]) followed by your content.
  3. Admonition Version: In the editor, type out the name of an admonition type in a code block (such as ```ad-tip) followed by your content on the subsequent lines.
  4. Ensure three backticks close your codeblock.
  5. Preview your note to see the formatted admonition.
```ad-tip
title: This is a tip

This is the content of the admonition tip.
```

Check out the plugin documentation for more detailed instructions and examples.

Support

If you encounter any issues, want to give back and help out, or have suggestions for new features, file an issue on the GitHub repository.

Complementary Plugins by Javalent

While we think all of our plugins are pretty awesome, we think these are especially awesome and work well with this plugin:

admonitions's People

Contributors

dependabot[bot] avatar gdyendell avatar github-actions[bot] avatar heinrich26 avatar martynkeigher avatar mitasov-ra avatar nathonius avatar ouatis avatar renmu123 avatar sigrunixia avatar tjkyner avatar valentine195 avatar xryul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

admonitions's Issues

Quotes in "Admonition Type" field causes rendering issues across all notes

I noticed that adding quotations in the "Admonition Type" field when creating a custom admonition type causes an issue with rendering across all notes, even if the note doesn't contain the admonition block. This happens with both double and single quotes. I haven't tested anything else.

image

Random test note in edit mode:
image
Same note when previewing:
image

The behavior is a bit inconsistent. Sometimes the note content will fully render.

Additionally, the console displays this error:

Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Element': 'code.language-ad-Exam"ple' is not a valid selector.
    at HTMLDivElement.Element.findAll (app://obsidian.md/app.js:1:265393)
    at app://obsidian.md/app.js:1:858332
    at Function.t.postProcess (app://obsidian.md/app.js:1:933599)
    at t.postProcess (app://obsidian.md/app.js:1:932200)
    at p (app://obsidian.md/app.js:1:847881)
    at e.onRender (app://obsidian.md/app.js:1:848141)

Alternate Syntax with empty Title

As i mentioned here : #42
I would like to use the boxes without the title-header-bar.

By now it is not possible to set an empty title like this:

!!! ad-info 
## Test
- here is some text
--- admonition

I also encountered that the content below the Heading does not render properly.

Issues with non-codeblock syntax

I'm excited to find the new option to enable non-codeblock. But it seems quite buggy so far. For example,

!!! ad-note
title: Hello
weqwe
!!!

which outputs

image

Also the preview of all other files often becomes empty if I enable this option.

Ticking checkboxes doesn't work

Very cool plugin to upgrade files visually! Thank you. Unfortunately it's not possible to tick checkboxes inside admonition enviroment in preview.

Admonitions don't render after the update to 4.2.0

My admonitions don't render after the update to 4.2.0. I get the following error in the console:

TypeError: Cannot read property 'trim' of undefined
    at ObsidianAdmonition.eval (eval at <anonymous> (app.js:1), <anonymous>:9921:35)
    at Generator.next (<anonymous>)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:31:71)
    at new Promise (<anonymous>)
    at __awaiter (eval at <anonymous> (app.js:1), <anonymous>:27:12)
    at ObsidianAdmonition.postprocessor (eval at <anonymous> (app.js:1), <anonymous>:9899:16)
    at app.js:1
    at Function.t.postProcess (app.js:1)
    at t.postProcess (app.js:1)
    at h (app.js:1)

Attaching a screenshot for reference:

Screenshot 2021-05-20 at 9 17 34 PM

"Custom Containers" syntax

Thks for your plugin which brings admonition block-styled content to Obsidian! (●'◡'●)

But why not use "Custom Containers" syntax instead of code-block with ad-*
I guess it's because Obsidian doesn't provide an API related to markdown custom syntax

These are some discussion about markdown extension syntax for custom containers:

New syntax

Hey, your plugin is absolutely stunning!

Only one thing will make it better: a diferent syntax.

The reason

Markdown links won't render, the notes remain as unlinked even thought they´re linked. Of couse this is due to obsidian codes behavior, so it will be cool if we a have a secondary render method to Admonitions so notes can be linked.

Pratical Example:

The way my note system works is based entirely in "Ad-question" Admonitions.
image
But, when a try to add any link inside a Admonition, the note linked remain as unlinked
image

It will be REALLY cool if this notes got linked!

"Failed to load plugin" error on Obsidian mobile 0.0.15

Hi,

Trying to enable the plug-in after an installation, while using Obsidian mobile 0.0.15 on an Android 10 devices, triggers an "Failed to load plugin" error toast.

Screenshot_20210406-122910_Obsidian

Does anyone manages to reproduce this problem ?

Thanks for your attention and your time.

Fix the header metadata resolution for markdown-style nested Admonitions

Here is an example of my note:

```ad-note
    My code:
    
    ```xml
    <tag>
        example
    </tag>
    ```
    
    More info
```

Expected behavior

Admonition renders properly with the code block and two paragraphs.

Actual behavior

Admonitions renders with the first paragraph and the code block. The second paragraph renders in a separate code block.

Is there any possible solutions fot that?
Maybe same approach as with nested admonitions can fix this?

P.S. I've tried to replace ``` with <pre> and it helped, but I lost syntax highlighting and horizontal scroll, so this solution is not good enough

Wrong spacing with Links and Mathjax inside title

Hey, its me again! :)

First of all, thanks for this speed of improving!

I found some issue (i think with the newest update, because this worked properly in the last versions i guess) which shows an wrong behaviour regarding the spacing between [[Links]] and $formula$ or $$formula$$ .. so mathjax in general.

image

This results to:

image

or without the Link and just the inline mathjax:

image

so the spacing is lost around these.

Collapsible by Default doesn't work

First of all, huge thanks for the amazing plugin. Recently, I observe that Collapsible by Default doesn't work anymore. Maybe it is because I upgrade to v0.12.4. Do you have any idea or if you need any information, please let me know!

Set `collapse: none` when option `Collapsible by default` isnt activated

Hey,

after the latest update 5.0.1 my beloved feature isnt working anymore.

I always used the admonition without any title

```ad-ai
title: 
##### Was versteht man unter [[Machine Learning]]?  
Some Text

and it rendered nicely to this block without the big titlebar.
image

Right now, with even "Collapsible by default" not set, it appears following notification:
image
with the titlebar rendered:
image

Is it possible to set collapse: none as default, when the option Collapsible by default isnt activated?
If I add collapse: none everything works fine, but than i had to edit all my blocks..

Tabbing dont work

Hey, it's me again.. :)

I encountered that -ing wont work like outside the codeblock:
image

It would be nice to get the nice fluent feeling like outside the codeblock where the next item is intended.

image

Which results to:

image

4.3.1 is not rendering for me

Left is editor, right is preview:

Screenshot from 2021-05-27 10-48-09

I am not 100% whether I was on 4.3.0 or 4.2.1 yesterday but everything was working fine. I tried uninstalling/re-installing as well as switching themes etc. No longer rendering for me anymore.

Obsidian v0.12.13

(FQ) Links Rendering in Graph View

Hello! I just want to say, this is one of my favorite and most used plugins!!! Thank you so much for building it ☺️. I did want to ask whether or not it is possible to have links used in admonition blocks render in the graph view? They do so properly in preview mode, but don't show up in the graph. Though, there was a moment where the links DID render (see image below). I still don't know how that happened but that leads me to believe that it could be a possibility. Thank you!

Screen.Shot.mp4

image

Second Collapse Arrow Appearing on the Left

Thanks for this amazing plugin! Is it possible to add an option to remove the triangle on the left of the admonition when collapse is enabled? I remember it wasn't there before version 4.1.0 or something. For me, the indicator on the right is more than enough. And the triangle is adding this extra layer of padding, which is a little excessive. Thank you!
Screen Shot 2021-05-18 at 11 02 45 PM

[Request] Command Prompt / Hotkeys for inserting specific admonition

Hi there, is it possible to have a shortcut for a specific admonition, that basically insert the boilerplate?

Maybe with a command prompt like ad-note

‘’’ ad-note
title:

‘’’

gets inserted.

Maybe there is already a solution to insert these templates. I am happy to configure them once.

Best regards and thank for the awesome plugin. :)

[Enhancement Req] Ability to copy content portion.

Hey!

I have started to use this plugin for some of the short, more 1-liner, code snippets as it looks much nicer than a code-block in a larger document. So having the ability to COPY, just the content, would be a nice addition to this plugin!

I know this was probably not an expected use case for this plugin, but having the ability to toggle on\off a copy feature on it (in it settings) for the few of us that could use it this way... would be amazing!!

://mk.

Speeding up Metadatacache and creating non-existing links

Hello,

I found some possible enhancement to the new metadata-feature.

  • It seems somehow laggy when creating Links and looking if they are created in the graph view (and sometimes dont even are created)
  • non-existing links wont be created

Title cuts off after second colon.

Heya! Cool plugin! I've noticed a li'l bug.
If you do this:

```ad-note
title: foo:bar
baz
```

everything after the second : gets cut off in the title. In this case 'bar' isn't visible in the preview.

(I quickly updated to 3.3.0 to check if this bug is still present. It is. But I noticed another bug after updating: In the examples in the Admonition Settings, the icons are centered and above the titles. Thankfully they render fine in the actual notes themselves.)

Custom Admonitions

Love the plugin - good work !

As title suggests - would be awesome to create some of my own

Plugin feedback

Just a little concerned that this plugin is using two dozen code block IDs. I've been contacted by several plugin developers about this who believes that this doesn't seem like a good idea.

I understand that this is for convenience, but I would highly suggest to either prefix your code block id, or use a single code block id but have the type as a content parameter, like you already do with title and collapse. This would reduce the likelihood of your plugin conflicting with another, causing confusion for the user.

Let me know what you think.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.