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

Ability to keep git changelog on separate file. Remove MD bold ** from readme.md #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

twoelevenjay
Copy link

For plugins thatkeep the changelog seperate in CHANGELOG.md with there git repo.

Also on GitHub I have the metadata titles bold with MD **. This was breaking the ability for wordpress.org to parse my readme.txt file.

Example:

**Tags:**                 metaboxes, forms, fields, options, settings  
**Requires at least:**    4.0  
**Tested up to:**         4.5  
**Stable tag:**           0.0.8  

@mallardduck
Copy link

These seem like good improvements. I wonder if @kasparsd would be willing to merge these in?

Hopefully they are still willing to maintain this project. If not I may take up a fork of my own to merge this in and provide more directions in the read my like #1 is requesting.

This has be very very useful to me as I've started working more on WordPress plugins and rely on git. To be honest I don't really use (or know how to use) SVN beyond what's required by wordpress.org. Without this as a resource I'd honestly feel pretty lost since I like the idea of: a) using git for wordpress plugins and b) don't want to fully learn SVN.

😄

Copy link
Owner

@kasparsd kasparsd 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 the pull request @twoelevenjay! Please see my comments and suggestions.

@@ -44,7 +44,11 @@ cd $DEST_DIR
# Transform the readme
if [ -f readme.md ]; then
mv readme.md readme.txt
sed -i '' -e 's/^# \(.*\)$/=== \1 ===/' -e 's/ #* ===$/ ===/' -e 's/^## \(.*\)$/== \1 ==/' -e 's/ #* ==$/ ==/' -e 's/^### \(.*\)$/= \1 =/' -e 's/ #* =$/ =/' readme.txt
if [ -f CHANGELOG.md ]; then
Copy link
Owner

Choose a reason for hiding this comment

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

@twoelevenjay Could we add support for both lowercase and uppercase filenames?

Choose a reason for hiding this comment

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

An interesting idea (having it be case-insensitive) however I think the issue is that the file system itself is case sensitive.

The best way to make it support both lowercase and uppercase filenames would be to code for both. Either by duplicating the code for both instances; or by turning the file paths into variables set based on which is found?

Choose a reason for hiding this comment

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

Maybe something like:

 if [ -f readme.md ]; then
  readmeMd='readme.md'
elif [ -f README.md ]; then
  readmeMd='readme.md'
else
  echo "Cannot find readme markdown file";
  exit;
fi

And then do something similar for the changelog.md file...then update the related code to match that idea?

cat CHANGELOG.md >> readme.txt
rm CHANGELOG.md
fi
sed -i '' -e 's/^# \(.*\)$/=== \1 ===/' -e 's/ #* ===$/ ===/' -e 's/^## \(.*\)$/== \1 ==/' -e 's/ #* ==$/ ==/' -e 's/^### \(.*\)$/= \1 =/' -e 's/ #* =$/ =/' -e 's/\*\*//g' readme.txt
Copy link
Owner

Choose a reason for hiding this comment

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

@twoelevenjay I'm not sure I understand this change. WP.org treats ** the same way as Markdown and converts them into strong. Why remove that formatting?

@mallardduck
Copy link

Hey @twoelevenjay I was wondering if you were going to continue with this? I really liked this idea and would love to see these changes merged in!

@efc
Copy link

efc commented Jun 18, 2020

Be aware that some plugins have both readme.txt and readme.md. If you do eventually update this script with support for this feature, please check for the existence of readme.txt before overwriting it.

@efc
Copy link

efc commented Jun 18, 2020

By the way, I noticed that even though this pull request was never acted on, a version of this code is now in place in deploy.sh. Since this breaks my plugins (which have both the MD and the TXT versions of README already), I had to fork and update the script. My update has both the code to protect readme.txt if it exists, and a much more descriptive readme file for this script. Please consider these changes for this version of the script.

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.

4 participants