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

FR: Differentiate between displayed and inserted text in Custom dictionaries #104

Closed
chrisgrieser opened this issue Mar 16, 2022 · 15 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@chrisgrieser
Copy link

Basically, what I am suggesting is an improvement to #37.
So in the the custom dictionary, we have currently three types of text:

  1. text that will be inserted, and is displayed in the suggester, and is matched (= insert-display-matching text)
  2. Text that only be displayed in the suggester as a subtitle (= description text)
  3. additional text that is matched(= matching text)

with the Delimiter to hide a suggestion we kind of get a fourth type of text:
4. text that will be inserted, but is not displayed in the suggester. (= display text)


I am envisioning something like this, basically making 1) display-only-text

  1. text that is only displayed in the suggester (= display text)
  2. text that is only displayed in the suggester as subtitle (= description text)
  3. text that is matched (= matching text)
  4. text that will be inserted (= insert text)

This would improve things like the citation autocompleter I built using your plugin, but it would also increase the flexibility of Various Complements in general for all kinds of use cases.

@tadashi-aikawa
Copy link
Owner

Hi, @chrisgrieser. Thanks for your FR :)

If it's ok with you that the specifications are as follows, I could implement them quickly.

// dictionary file. ;;;; is delimiter for this feature
displayed-text;;;;<div>template</div>,description,aliases1,aliases2
  • It shows displayed-text, not <div>template</div>
  • It inserts <div>template</div>, not display-text
  • It matches by search both displayed and template

@chrisgrieser
Copy link
Author

  • It shows displayed-text, not <div>template</div>
  • It inserts <div>template</div>, not display-text
  • It matches by search both displayed and template

yes, that would suffice, too!

@tadashi-aikawa tadashi-aikawa self-assigned this Mar 17, 2022
@tadashi-aikawa tadashi-aikawa added the enhancement New feature or request label Mar 17, 2022
@tadashi-aikawa
Copy link
Owner

tadashi-aikawa commented Mar 19, 2022

@chrisgrieser

I have updated beta version to obsidian-various-complements-plugin-beta v5.10.0-beta1 🚀

Please confirm whether it works as you expected. (and hopefully not found bugs 😉 )

@tadashi-aikawa
Copy link
Owner

Released v5.10.0.beta-2 🚀

@chrisgrieser
Copy link
Author

can confirm, works as intended :)

@tadashi-aikawa
Copy link
Owner

Thanks for your confirmation!

I will reopen this issue because I have not released it officially :)

And I will modify 🖼️Add a word to a custom dictionary dialog, too 👍

@tadashi-aikawa
Copy link
Owner

P.S. This feature is very compatible with like callouts 😄

image

@chrisgrieser
Copy link
Author

chrisgrieser commented Mar 20, 2022

P.S. This feature is very compatible with like callouts 😄

that was exactly what I was thinking and doing right now as well! 😆

I added this to my custom dictionary (| as delimiter, >>> as insert/display delimiter)

%% Callouts %%
note>>>> [!NOTE]\n> |callout|note|callout
abstract>>>> [!ABSTRACT]\n> |callout|abstract|callout
summary>>>> [!SUMMARY]\n> |callout|summary|callout
tldr>>>> [!TLDR]\n> |callout|tldr|callout
info>>>> [!INFO]\n> |callout|info|callout
todo>>>> [!TODO]\n> |callout|todo|callout
tip>>>> [!TIP]\n> |callout|tip|callout
hint>>>> [!HINT]\n> |callout|hint|callout
important>>>> [!IMPORTANT]\n> |callout|important|callout
success>>>> [!SUCCESS]\n> |callout|success|callout
check>>>> [!CHECK]\n> |callout|check|callout
done>>>> [!DONE]\n> |callout|done|callout
question>>>> [!QUESTION]\n> |callout|question|callout
help>>>> [!HELP]\n> |callout|help|callout
faq>>>> [!FAQ]\n> |callout|faq|callout
warning>>>> [!WARNING]\n> |callout|warning|callout
caution>>>> [!CAUTION]\n> |callout|caution|callout
attention>>>> [!ATTENTION]\n> |callout|attention|callout
failure>>>> [!FAILURE]\n> |callout|failure|callout
fail>>>> [!FAIL]\n> |callout|fail|callout
missing>>>> [!MISSING]\n> |callout|missing|callout
danger>>>> [!DANGER]\n> |callout|danger|callout
error>>>> [!ERROR]\n> |callout|error|callout
bug>>>> [!BUG]\n> |callout|bug|callout
example>>>> [!EXAMPLE]\n> |callout|example|callout
quote>>>> [!QUOTE]\n> |callout|quote|callout
cite>>>> [!CITE]\n> |callout|cite|callout

@tadashi-aikawa
Copy link
Owner

We were thinking about the same thing!

At that time, I thought it was satisfied using aliases without implementing the new feature. But I noticed we need not memorize the list of callouts and can filter even after inputting words if there are the same prefixes (ex: ad-), and it can't be realizable without your feature request 👍

📝ad-note >>> > [!note]\n> ,メモ書き
ℹ️ad-info >>> > [!info]\n> ,関連情報
🔥ad-hint >>> > [!hint]- <CARET>\n> ,深堀りした情報(タイトル: 深堀する内容)
⚠ad-attention >>> > [!attention]\n> ,見なくてもいい注意書き
⚠ad-caution >>> > [!caution]\n> ,被害を被る可能性がある、見てほしい注意書き
⚠ad-warning >>> > [!warning]\n> ,被害を被る可能性が高いので、必ず見てほしい注意書き
🌩ad-danger >>> > [!danger]\n> ,必ず被害を被るので、絶対に見てほしい注意書き
🌩ad-error >>> > [!error]- <CARET>\n> ,エラーが発生したときの補足(タイトル: エラー文言)

@tadashi-aikawa
Copy link
Owner

Coming soon! 🦉

2022-03-24_18h48_43.mp4

tadashi-aikawa added a commit that referenced this issue Mar 24, 2022
@tadashi-aikawa
Copy link
Owner

Released v5.10.0 🚀

@chrisgrieser
Copy link
Author

chrisgrieser commented Apr 2, 2022

Btw, you should definitely showcase using Various complements for callouts. It's in my view the best method to write callouts, and it would be a bummer when only the two of us do that 😆

In the docs and Discord or sth?

@tadashi-aikawa
Copy link
Owner

Sounds good!

I'll create a page in the docs and some custom dictionary example files first.

@tadashi-aikawa tadashi-aikawa added the documentation Improvements or additions to documentation label Apr 6, 2022
@tadashi-aikawa
Copy link
Owner

Added https://tadashi-aikawa.github.io/docs-obsidian-various-complements-plugin/6.%20Showcase/%F0%9F%93%93Custom%20dictionary%20examples/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants