8000 Code fence language/filename display customization (`g:previm_code_language_show` ) by KSR-Yasuda · Pull Request #221 · previm/previm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Code fence language/filename display customization (g:previm_code_language_show ) #221

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

Merged
merged 4 commits into from
Jun 4, 2025

Conversation

KSR-Yasuda
Copy link
Contributor

For g:previm_code_language_show,
code block language ```lang and filename ```lang:filename.txt are both assigned to div.code-lang.
To show only filename-specified cases, shouldn't it be recognizable?

Added a class name code-lang-title for the cases of ```lang:filename.txt to hide language-only cases in css as below:

.code-lang:not(.code-lang-title) {
    display : none;
}

…tle mode

- `g:previm_code_language_show` works as
    - <= 0        : Disabled
    - 1 or others : Show ether language name or file name
    - 2           : Show if file name is specified (do not show language name)
@KSR-Yasuda
Copy link
Contributor Author

Or we should rather change g:previm_code_language_show behavior as mode selection?

For example, 1 is ether language/filename, 2 is filename only, etc.

@KSR-Yasuda KSR-Yasuda changed the title Set .code-lang-title for filename specified code block Code fence language/filename display customization (g:previm_code_language_show ) May 14, 2025
@KSR-Yasuda
Copy link
Contributor Author

Switched to the way of mode selection.

Copy link
Member
@lambdalisue lambdalisue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but the behavior must be written in docs.

@KSR-Yasuda
Copy link
Contributor Author

Updated the docs.

@KSR-Yasuda KSR-Yasuda requested a review from lambdalisue May 30, 2025 00:01
@lambdalisue lambdalisue merged commit 0918a3a into previm:master Jun 4, 2025
6 checks passed
@lambdalisue
Copy link
Member

Thanks 🎉

@KSR-Yasuda KSR-Yasuda deleted the feature/CodeBlockTitleClass branch June 4, 2025 23:50
@KSR-Yasuda
Copy link
Contributor Author

Thank you for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0