Skip to content

Conversation

@FloEdelmann
Copy link
Member

@FloEdelmann FloEdelmann commented Oct 22, 2020

Closes #3672.

I've left a settings object (that is empty in most features) in features.add, because both disabled and shortcuts need to be defined there.

The first two commits actually change some of the descriptions/screenshots, so that the later commits don't introduce any changes that are not visible in any diff. I've made those changes manually (with a helper function that generates two files that I could diff).

Implemented in this PR:

  1. Parse features' description and screenshot from readme.
  2. Disable features by commenting them out in refined-github.ts.
  3. Move shortcuts from FeatureMeta to FeatureLoader.
  4. Drop the FeatureMeta parameter from features.add.
  5. Render <i> and <kbd> tags in addon options:
  6. Update parseBackticks, so that `` ` `` and `` `bla` `` are also parsed correctly (and add some tests for it).
  7. Improve some feature descriptions.
  8. Add and use a concatRegex helper (suggested by @fregante in Meta: Use the Readme as the only source of feature descriptions #3678 (comment)).

Copy link
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this 🍰

@fregante fregante added meta Related to Refined GitHub itself and removed enhancement labels Oct 22, 2020
@FloEdelmann FloEdelmann requested a review from fregante October 22, 2020 13:16
@FloEdelmann
Copy link
Member Author

Thanks for your quick and very helpful review @fregante! I think I have now implemented all your feedback. I really like how commenting out the import statement disables the feature now!

@FloEdelmann FloEdelmann requested a review from fregante October 22, 2020 17:35
Copy link
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

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

Untested, but looks good so far

domFormatters.linkifyURLs(descriptionElement);
domFormatters.parseBackticks(descriptionElement);
parseSimpleInlineElement(descriptionElement, 'i');
parseSimpleInlineElement(descriptionElement, 'kbd');
Copy link
Member

Choose a reason for hiding this comment

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

This has been bugging me because we've ended up pars͡iǹģ H҉T͠M͚̼̱L̷ w̱̳i̓ͭͪ̅͌ṫ͓̼̬̜̔h͐͑͆̊̄͏̟ re̝̘̱̣̥͙͔̝̫͙̯̣ͣ͗ͨ̿̏̌ͤ̋́g̶̟̻̻̳̯̹̞̥̰̲͙̮̝͂̋̾͋̽̂̽̚e͋̔͆̑̌̎͗́̂ͮ̌̅͞҉̛̟͙̠͍̠͍̪͍̝̲̪̳͈̰͍x̷̡̡̢̖̗̞̫̠͉̪ͧ̄̎̌̎ͫ.

Here or in a separate PR I'd like to see the most lightweight Markdown parser being run directly to the description text to store HTML so the entire parseDescription function can be dropped

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

This has been bugging me because we've ended up pars͡iǹģ H҉T͠M͚̼̱L̷ w̱̳i̓ͭͪ̅͌ṫ͓̼̬̜̔h͐͑͆̊̄͏̟ re̝̘̱̣̥͙͔̝̫͙̯̣ͣ͗ͨ̿̏̌ͤ̋́g̶̟̻̻̳̯̹̞̥̰̲͙̮̝͂̋̾͋̽̂̽̚e͋̔͆̑̌̎͗́̂ͮ̌̅͞҉̛̟͙̠͍̠͍̪͍̝̲̪̳͈̰͍x̷̡̡̢̖̗̞̫̠͉̪ͧ̄̎̌̎ͫ.

😁 Yes I know, this is not the cleanest way, but I didn't want to completely change it to a real Markdown parser.

Here or in a separate PR I'd like to see the most lightweight Markdown parser being run directly to the description text to store HTML so the entire parseDescription function can be dropped

I'll give it a shot in a new PR, I think this one is large enough 😅

FloEdelmann and others added 3 commits October 23, 2020 09:08
Co-authored-by: Federico <opensource@bfred.it>
Co-authored-by: Federico <opensource@bfred.it>
@fregante
Copy link
Member

The only problem I found is that readme.md is not a watched file, so changes to it will only appear once another file is changed. If there's an easy solution (that doesn't involve a bunch of code and/or a loader), it'd be good to fix it.

@fregante fregante changed the title Read screenshot and description from readme Meta: Use the Readme as the only source of feature descriptions Oct 25, 2020
@fregante fregante merged commit 5b6b9c0 into refined-github:master Oct 25, 2020
@fregante
Copy link
Member

🤝

@FloEdelmann FloEdelmann deleted the parse-readme-feature-meta branch October 25, 2020 08:28
@FloEdelmann
Copy link
Member Author

FloEdelmann commented Oct 25, 2020

readme.md is not a watched file, so changes to it will only appear once another file is changed. If there's an easy solution (that doesn't involve a bunch of code and/or a loader), it'd be good to fix it.

Would something like this be an "easy solution that doesn't involve a bunch of code"?
https://stenvdb.be/articles/how-to-live-reload-webpack-dev-server-when-saving-external-files

Alternatively, there are two Webpack plugins that basically use that code: https://github.com/Fridus/webpack-watch-files-plugin and https://github.com/pigcan/extra-watch-webpack-plugin

@fregante
Copy link
Member

fregante commented Nov 5, 2021

Would something like this be an "easy solution that doesn't involve a bunch of code"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta Related to Refined GitHub itself

Development

Successfully merging this pull request may close these issues.

Read screenshot and description from readme

3 participants