badge-generator icon indicating copy to clipboard operation
badge-generator copied to clipboard

Extend HTML code view

Open MichaelCurrin opened this issue 4 years ago • 11 comments

This is useful for toggling from markdown to HTML for where markdown is not valid, like a centered div on a Jekyll site or Docsify.

This is not so often needed, so it can be a toggle rather than cluttering the screen with this and standard.

MichaelCurrin avatar Apr 14 '21 14:04 MichaelCurrin

Hi @MichaelCurrin Can I work on this issue? And if you could, can you please provide more details?

irenejoeunpark avatar Nov 18 '21 21:11 irenejoeunpark

Hi thanks for the interest.

I actually added this already with limited functionality, across views.

Screen Shot 2021-11-19 at 12 07 09 pm Screen Shot 2021-11-19 at 12 07 12 pm

MichaelCurrin avatar Nov 19 '21 10:11 MichaelCurrin

But something useful would be to store that value in the store in store.ts

i.e. you could tick or untick that checkbox and it will be remembered when navigating across views. and also on the catalogue page, you would tick or untick one item and all the others on the same page would update too.

e.g.

Screen Shot 2021-11-19 at 12 09 48 pm Screen Shot 2021-11-19 at 12 10 00 pm

MichaelCurrin avatar Nov 19 '21 10:11 MichaelCurrin

And then a small change on the HTML functionality would be to trim the newline from the end of every HTML block when the MD to HTML happens.

Compare these two with my selection to highlight the issue:

Screen Shot 2021-11-19 at 12 14 07 pm Screen Shot 2021-11-19 at 12 14 00 pm

Such as in here

https://github.com/MichaelCurrin/badge-generator/blob/771595c6a8f9267c4a28da997c77b156746252da/src/core/markdown.ts#L70-L73

If you add .trim() in there to wrap that render.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim

MichaelCurrin avatar Nov 19 '21 10:11 MichaelCurrin

And then a small change on the HTML functionality would be to trim the newline from the end of every HTML block when the MD to HTML happens.

Compare these two with my selection to highlight the issue:

Screen Shot 2021-11-19 at 12 14 07 pm Screen Shot 2021-11-19 at 12 14 00 pm

Such in here

https://github.com/MichaelCurrin/badge-generator/blob/771595c6a8f9267c4a28da997c77b156746252da/src/core/markdown.ts#L70-L73

If you add .trim() to wrap that

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim

Okay, I will work on that update! Thanks for the details

irenejoeunpark avatar Nov 22 '21 08:11 irenejoeunpark

Hi @MichaelCurrin, I keep getting errors running the application. Or I might not be using the correct way to run vue app. Could you tell me what environment setup is needed and which command to use to run the application?

irenejoeunpark avatar Nov 24 '21 05:11 irenejoeunpark

Can you add a screen shot and what commands you are running?

Node 16 Any OS

yarn install
yarn start

MichaelCurrin avatar Nov 24 '21 06:11 MichaelCurrin

Test the app on the main branch with no changes.

Then test again with your changes

MichaelCurrin avatar Nov 24 '21 06:11 MichaelCurrin

Can you add a screen shot and what commands you are running?

Node 16 Any OS

yarn install
yarn start

I was using the wrong command. It is working now thanks! I will create PR as soon as I finish with my change and tests

irenejoeunpark avatar Nov 24 '21 14:11 irenejoeunpark

Hi @MichaelCurrin, PR #135 is created for those two changes.

irenejoeunpark avatar Nov 26 '21 04:11 irenejoeunpark

can you have a look at the PR for my requested changes?

In particular the view on the Catalogue page is confusing and I could not figure out myself how to sync the checkbox value across all items on the page.

Another solution I'd accept is to refactor the Catalogue page to have a single HTML checkbox option, maybe in a footer of the page that is always visible, or a in the navbar.

MichaelCurrin avatar Nov 29 '21 10:11 MichaelCurrin