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

Feature request: fold the code [solved] #200

Closed
xiekeyi98 opened this issue Mar 26, 2018 · 16 comments
Closed

Feature request: fold the code [solved] #200

xiekeyi98 opened this issue Mar 26, 2018 · 16 comments

Comments

@xiekeyi98
Copy link

xiekeyi98 commented Mar 26, 2018

I want to have a good feature , which is can fold the code . ( If user click the button , all the code will be show , reversely , it will not show too many lines.

I looked at the latest features and don't seem to have the support.

And I found someone implement the feature by modify the themes/next/source/js/src/post-details.js
( links: http://www.bubuko.com/infodetail-2466336.html sorry for Chinese )

It sounds a great feature , isn't?

@ivan-nginx
Copy link
Member

Fold — it's like spoiler? Somewhere i can see example with code folding?

@sli1989
Copy link
Collaborator

sli1989 commented Mar 26, 2018

@ivan-nginx
Copy link
Member

So? Here is plugin hexo-sliding-spoiler.
BTW, same function can be implemented by tab tag.

@xiekeyi98
Copy link
Author

I'm sorry to bother you.

With the help of everyone, the problem has been solved perfectly.

@xiekeyi98 xiekeyi98 reopened this Mar 26, 2018
@xiekeyi98
Copy link
Author

@ivan-nginx I tested the plugin ..
Ah, Have a good way to make the code highlight?

@ivan-nginx
Copy link
Member

What u want, i don't understand.

@ivan-nginx ivan-nginx mentioned this issue Mar 26, 2018
72 tasks
@sli1989
Copy link
Collaborator

sli1989 commented Mar 26, 2018

@xiekeyi98 the use of highlight with codeblock can check this.

@xiekeyi98
Copy link
Author

@sli1989 you mean I should use the codeblock to make the code highlight , and use the other plugins or functions to fold the code like spoiler ?

@xiekeyi98
Copy link
Author

xiekeyi98 commented Mar 26, 2018

Simply to say , I want to fold the code like ~~~spoiler~~~( I found the spoiler is not what I want ) , and can highlight the code easiliy .( I want to choose the language like markdown . Now some implementation can not choose the language.

@sli1989
Copy link
Collaborator

sli1989 commented Mar 26, 2018

they are difference function and not contradictory...
the spoiler plugin doesn't render your code block, add something you want to fold inside tags, include code block.

@xiekeyi98
Copy link
Author

@sli1989 Thanks a lot .
I will try to do it .
And hope this features can be protogenesis.


And have to say that I am so sorry for my poor English.

@xiekeyi98
Copy link
Author

I use the :

{% spoiler title %}

{% codeblock lang:XXX %}
my code
my code
{% endcodeblock %}
{% endspoiler %}

Finish my problem .

@yanickxia
Copy link

@ivan-nginx i think spoiler maybe not a good way, it's best way that we can add _config.yml codeblock add a item is 'fold: [true/false]', what do you think?

@ivan-nginx
Copy link
Member

It's will be something like autospoiler? You want to fold all your code blocks by default, if option fold will be true?

Can u try to use tabs tag? It looks something like that:

image


I just still don't understand what u exactly want. I think your code blocks very big to height and user must a lot of scroll your post, and information became not nice-looking. So, for good give your info from your blog you must economize vertical scroll of current page on maximum and use colorized instruments to design your post to better reading.

@ivan-nginx ivan-nginx reopened this Jul 2, 2018
@yanickxia
Copy link

@ivan-nginx you're right, i think it's good for me,thanks

@ivan-nginx ivan-nginx changed the title Want to a new feature. Want to a new feature. [solved] Mar 4, 2019
@stevenjoezhang stevenjoezhang changed the title Want to a new feature. [solved] Feature request: fold the code [solved] Mar 20, 2019
@theme-next theme-next locked as resolved and limited conversation to collaborators Apr 1, 2019
@stevenjoezhang
Copy link
Contributor

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

No branches or pull requests

5 participants