typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.53k stars 58 forks source link

Template / Skeleton File or Default YAML Block #863

Open erikhe90 opened 7 years ago

erikhe90 commented 7 years ago

It would be great to be able to define a default YAML block that is entered in every file that is created. This would allow to define an image folder or a root URL:

typora-copy-images-to: .images
typora-root-url: ./

Alternatively, this could be done by defining a skeleton file that is used instead of an empty file when creating a new one.

Related to: #274, #423

dejan-stankovic commented 6 years ago

great suggestion! I would also like to be able hide YAML Block as it is annoying/distracting. it could be that i just didn't find a way how to hide it...

asins commented 6 years ago

Has this function been added? Every time you paste a picture in a new document, you have to add YAML information first, which interrupts the user's operation.

这个功能有加入吗?每次在新文档中粘贴图片都要先添加YAML信息,这打断了用户的操作。

gandalfsaxe commented 6 years ago

I agree; I really only use the YAML header for providing a path for any pasted images, which is required. It'd be nice to have a default location for these, and a possible way to do this would be a default YAML that always applies (bonus points if this can be hidden).

Even better solution would be support for textbundle, which is the most elegant solution to keeping plaintext MD files and their associated image assets together.

sheldonhull commented 6 years ago

I came looking for a way to setup something similar to prose config with typora. I'd love to setup my default front matter for jekyll posts as well as default image paths. Since I use /assets/img/imagename, having this as front-matter for all my posts in a directory would be useful.

Perhaps use the same concept as a config in jekyll or git ignore. Allow a .typoraconfig in a directory, or subdirectory to override with default values for front matter. This would give a lot of flexibility for using Typora for blogging through Jekyll, and other static tools, as well as for other purposes.

vassudanagunta commented 6 years ago

@abnerlee It would be almost trivial for Typora to add two new menu items (or two buttons in the preferences panel):

Keeping them as separate options provides the most flexibility, as only supporting the first option doesn't help people who have to add front matter to existing files.

I often have to add a category and tags to my documents and have to manually type the following every time:

---
category:
tags: []
---
gensmusic commented 5 years ago

I really need a global setting for typora-root-url, I always work on different platforms like osx, linux and windows, it's fustrating to set the typora-root-url as the folder cann't be the same on different platforms

abnerlee commented 5 years ago

Use duplicate in file panel would be a workaround in new version

Sandai64 commented 5 years ago

Please, like @gensmusic, I use Windows alongside Linux and it's really frustrating to use !

christophcemper commented 5 years ago

We need the same kind of templating function for YAML

TigersWay commented 4 years ago

Perhaps use the same concept as a config in jekyll or git ignore. Allow a .typoraconfig in a directory, or subdirectory to override with default values for front matter. This would give a lot of flexibility for using Typora for blogging through Jekyll, and other static tools, as well as for other purposes.

That would be Soooo great!!!

sheldonhull commented 3 years ago

⬆️ bump. Would really like to have either:

0x413x4 commented 2 years ago

+1

I would really like to see a feature akin to the templates in Obsidian, whereby you click on an icon, select a template, and it copies the content of the template in the current document. Bonus point if we can have very basic placeholders, such as {{filename}} or {{date}}.

sheldonhull commented 2 years ago

Bump. Still something I'd like to see. Right now my repo front matter is covered typora values to make sure it can resolve images for blogging. I'd love to have a config file in my repo root or some type of way to set this besides per document.

AyiStar commented 1 year ago

Bump. Need this feature, too. Is there any updates on the development?

sospiess commented 9 months ago

YES! This would be a really useful feature. To me, the proposal by @0x413x4 would have the most benefit. I don't need one template automatically applied all the time, but have several types of documents I use frequently and would like some consitency. For instance, one template for meeting minutes, another one for user stories, etc..

Right now, I first need navigate to and open a template (which probably isn't in the currently opended folder and thus easily selectable), and then SAVE AS it in the correct location (which makes it dangerous to inadvertenly overwrite the template with autosave turned on, when I start jotting away meeting attendees' remarks before I explicitly save the document.

Being able to store "read-only" document templates somewhere, which get opened as new files/copies in the background would be just wonderful. Those templates could easily be prepared with or without a yaml frontmatter by the user. Finally, one of those templates could also be set as the default for all "new" documents, if so desired by a user.

myob-hankun commented 7 months ago

Hi Team, Do we have a plan to do template feature? It's important