# Please make it possible to include JS/CSS files in markdown rendering from Application Support folder

**URL:** <https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539>\
**Category:** Feedback\
**Created:** [September 25, 2020, 7:56pm UTC](https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539 "2020-09-25T19:56:57Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmynsted](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/mmynsted/32/9470_2.png) [@mmynsted](https://discourse.devontechnologies.com/u/mmynsted)\
**Post date:** [September 25, 2020, 7:56pm UTC](https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539/1 "2020-09-25T19:56:58Z")

</div>

## Proposed improvement

I use the built-in Prism every day in my _DEVONthink_ `markdown` documents to improve their appearance. I would like to customize the implementation for my needs, such as expanding the syntax highlighting. It would be possible today for me to manually link all my `markdown` document to my own Prism implementation. I have tried this. It works but has challenges.

## Challenges without the proposed solution

- It requires a special location for my Prism implementation.
  - **In a database** This is would work and work across upgrades but only for the database where the implementation is stored. _This requires that I link out from each `markdown` document_.
  - **In a neutral location on my local filesystem** This would work across upgrades and would be consistent for all databases. _This requires that I link out from each `markdown` document_.

## Better location

- **The `Application Support` folder** This is a better location but DEVONthink would need to be modified to implement this. It would work across upgrades. It would work for all databases. It would not require that I alter any existing or future `markdown` documents. It would permit near complete flexibility.

## The proposed solution addresses these key challenges because

- It would permit greater flexibility for `markdown` rendering customization because changes would be made in one place and existing document would not be modified.
- It would permit a location that is both resistant to upgrades and accessible from any database.
- It would permit a consistent user experience for those that wish to customize their `markdown` rendering. This means it could be described in the DEVONthink manual.
- It would permit users to include their own JavaScript, CSS, or other content in addition to or in place of Prism. Who knows what people may come up with? It separates the semantic markup from the presentation experience.
- It would prevent the need for users to alter their existing and future `markdown` documents. (This is a big deal for me because I have many markdown documents and plan to have many more.)
- It would permit users who do not wish to alter the `markdown` rendering, to continue to use DEVONthink exactly as they do today without noticing any changes.

## Proposed solution

Have a file in the `Application Support` folder that is always included when a _markdown_ file is rendered by **DEVONthink**.

The file would be empty by default. This would ensure it would not alter the behavior of the `markdown` rendering unless action was taken by the user.

A user who wished to customize the rendering of their `markdown` documents could include links or other content in that file to their own `prism.js` and `prism.css`. Those custom Prism files could reside in this same location in `Application Support` as the _include_ file. This would permit the customizations to persist over upgrades, much like they would if they were stored in a **DEVONthink** database.

It would also permit users to share the markdown rendering experience _across many **DEVONthink** databases_ since the files are equally available to all the open **DEVONthink** databases.

I am a software developer and I am happy to do (some) of the work, but would obviously need permission and direction from _DEVONtechnologies_. I do not know how this is handled with DEVONthink.

Please consider this proposal.

---

<div class="post-metadata">

**Author:** ![jandubois](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/jandubois/32/5809_2.png) [@jandubois](https://discourse.devontechnologies.com/u/jandubois)\
**Post date:** [September 25, 2020, 9:26pm UTC](https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539/2 "2020-09-25T21:26:09Z")

</div>

Could you explain why you prefer using external files. I’ve made a similar suggestion [here](https://discourse.devontechnologies.com/t/can-we-get-a-preference-setting-for-global-custom-javascript-to-be-included-in-markdown-rendering/58074), which builds on the way you can already specify a custom CSS file via a URL, so it can be either a local file, or an item link. We just need a second options like that for a JavaScript file, and we should be all set.

I prefer “my” suggestion because it is more general, and potentially extends trivially to DTTG as well.

---

<div class="post-metadata">

**Author:** ![mmynsted](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/mmynsted/32/9470_2.png) [@mmynsted](https://discourse.devontechnologies.com/u/mmynsted)\
**Post date:** [September 25, 2020, 10:09pm UTC](https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539/3 "2020-09-25T22:09:57Z")

</div>

You have a good point. The issue I have with a preference for a `JavaScript` URI is that DEVONthink knows it is a single `JavaScript` file. I could add what I want in that `JavaScript` file but now it is updates in two places.

It limits my flexibility because that entity must be `JavaScript`. The same is true for `CSS` etc. In the case of `JavaScript`, DEVONthink would be generating the script tag for me and I would be providing only the URI. A file permits me to add my own tags for my own inclusions. I could add as many or a few as I like.

## I think I see a compromise.

What if DEVONthink had a dialogue in the preferences, much like the `Annotations` dialogue?

One could enter anything they like, just like a file on the file system. It would be far easier to deal with because one could make modifications without needing the command line. Nobody would need to know or care where that preference is stored so long as it is accessible to any open database.

There could be a default template with the script and css tags needed to include a `JavaScript` or `CSS` file by URI. Most users would simply add their URIs. Any valid URI should work fine but they would, of course have different accessibility restrictions.

- **Local file** : Should be accessible by any open database
- **Item link** : ` x-devonthink-item:` . . . Should be accessible so long as the database with the DEVONthink item is open.
- **Remote URI** : Should be accessible so long as one has connectivity to the remote site.

I want to also be sure that whatever is added affects only `markdown` rendering.

---

<div class="post-metadata">

**Author:** ![BLUEFROG](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/bluefrog/32/135_2.png) [@BLUEFROG](https://discourse.devontechnologies.com/u/BLUEFROG)\
**Post date:** [September 26, 2020, 1:31am UTC](https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539/4 "2020-09-26T01:31:57Z")

</div>

> There could be a default template with the script and css tags needed to include a `JavaScript` or `CSS` file by URI.

You can already create your own template Markdown file using any of the JavaScript or stylesheet linking methods… or even one with default internal styling.

---

<div class="post-metadata">

**Author:** ![mmynsted](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/mmynsted/32/9470_2.png) [@mmynsted](https://discourse.devontechnologies.com/u/mmynsted)\
**Post date:** [September 26, 2020, 1:46am UTC](https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539/5 "2020-09-26T01:46:17Z")

</div>

So long as it changes the rendering of the `markdown` file and not the `markdown` document its self. I only know how to make a document template, not a rendering template.

---

<div class="post-metadata">

**Author:** ![thomas.krampe](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/thomas.krampe/32/18000_2.png) [@thomas.krampe](https://discourse.devontechnologies.com/u/thomas.krampe)\
**Post date:** [May 29, 2021, 9:17am UTC](https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539/6 "2021-05-29T09:17:55Z")

</div>

Any news?

---

<div class="post-metadata">

**Author:** ![BLUEFROG](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/bluefrog/32/135_2.png) [@BLUEFROG](https://discourse.devontechnologies.com/u/BLUEFROG)\
**Post date:** [May 29, 2021, 11:41am UTC](https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539/7 "2021-05-29T11:41:57Z")

</div>

No. There is no news on this.

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [May 31, 2021, 7:55am UTC](https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539/8 "2021-05-31T07:55:27Z")

</div>

> [@thomas.krampe](#):
>
> Any news?

Just curious but what exactly does (or would) your script do?

---

<div class="post-metadata">

**Author:** ![thomas.krampe](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/thomas.krampe/32/18000_2.png) [@thomas.krampe](https://discourse.devontechnologies.com/u/thomas.krampe)\
**Post date:** [May 31, 2021, 8:11am UTC](https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539/9 "2021-05-31T08:11:49Z")

</div>

Not sure what you mean with this answer to my post, please clarify!

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [May 31, 2021, 8:14am UTC](https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539/10 "2021-05-31T08:14:18Z")

</div>

A global stylesheet can be already specified in Preferences \> Markdown \> Media, therefore I assumed that you want to specify a JavaScript file in the same preferences pane too. And now I wonder what the purpose of this script is. Just customised Prism support or anything else?

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [May 31, 2021, 8:27am UTC](https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539/11 "2021-05-31T08:27:09Z")

</div>

Though you didn’t ask _me_, I’d answer: Possibly add functions that are not available (yet). Like

- unsupported markdown formats (like check boxes in ancient times 😉
- special HTML processing that’s not available in the current MD processor: maybe generating a TOC automatically or including images as data-urls or …

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [May 31, 2021, 10:19am UTC](https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539/12 "2021-05-31T10:19:18Z")

</div>

The next release will support this.

---

<div class="post-metadata">

**Author:** ![mmynsted](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/mmynsted/32/9470_2.png) [@mmynsted](https://discourse.devontechnologies.com/u/mmynsted)\
**Post date:** [May 31, 2021, 4:38pm UTC](https://discourse.devontechnologies.com/t/please-make-it-possible-to-include-js-css-files-in-markdown-rendering-from-application-support-folder/58539/13 "2021-05-31T16:38:51Z")

</div>

😍 🎉

Thank you. I am excited for this!
