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

Added treeview plugin #2265

Merged
merged 4 commits into from
Mar 28, 2020
Merged

Conversation

RunDevelopment
Copy link
Member

This is a port of @Golmote's prism-treeview plugin with some minor changes.

This resolves #2264.

@muescha
Copy link

muescha commented Mar 25, 2020

make it sense to split the css into 2 parts:

  • one with the colors plugins/treeview/prism-treeview.css
  • one with only icons plugins/treeview/prism-treeview-icons.css

this way it is possible to:

Copy link
Contributor

@Golmote Golmote left a comment

Choose a reason for hiding this comment

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

That was quick! Thank you for adding this.

plugins/treeview/prism-treeview.js Outdated Show resolved Hide resolved
@Golmote
Copy link
Contributor

Golmote commented Mar 25, 2020

@muescha I do not think a Prism plugin can have multiple CSS files currently. Whoever wants to change the icons will need to replace the whole file, or override just the needed parts.
But the codeblock colors will come from the selected theme anyway, the only remaining color is the color of the borders used to draw the filetree lines, which can be overriden too.

@mAAdhaTTah
Copy link
Member

Yeah, multiple CSS files would make the babel plugin more complicated as well, which assumes max one CSS file per plugin.

@RunDevelopment
Copy link
Member Author

Splitting the CSS is sorta possible with #2162.
Assuming that users build their theme on the download page, we can just cut out the predefined icons (and maybe even insert other ones).

@RunDevelopment
Copy link
Member Author

Regarding the babel plugin: We could use something like a no-default-icon-set class to mark code blocks with a custom one. This won't do anything for CSS bundle size, but it'll work.
(The class will be inherited, so you can define it in the <body> and have it affect the whole page.)

@muescha
Copy link

muescha commented Mar 25, 2020

make it sense also include beginning slashes as directory?

/my-my-site
└── my-config.js
└── /src
└── /plugins

@RunDevelopment
Copy link
Member Author

Directories are usually denoted by a trailing slash:

foo/       # directory
`-- bar    # file

That being said, the plugin will remove the trailing slash (and even similar file markers).

@RunDevelopment RunDevelopment merged commit be909b1 into PrismJS:master Mar 28, 2020
@RunDevelopment RunDevelopment deleted the treeview branch March 28, 2020 13:33
quentinvernot pushed a commit to TankerHQ/prismjs that referenced this pull request Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

language request: treeview
4 participants