Skip to content
المشاريع

حول

WordPress plugin that makes it easy to post syntax-highlighted code snippets.

تطوير الويب والتطبيقات

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
+١
خلال 15 يومًا
+١
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

SyntaxHighlighter Evolved

WordPress Plugin Version WordPress Tested WordPress Plugin Downloads WordPress Plugin Rating

Easily post syntax-highlighted code to your WordPress site without having to modify the code at all. As seen on WordPress.com.

Supports the new Gutenberg editor!

Development

You need Docker, Node and Composer. Run make help to list every target.

  • make install installs the Composer and npm dependencies.

  • make up starts WordPress with the plugin active at http://localhost:8890 (log in with admin/password). make down stops it.

  • make test runs the PHPUnit suite in a separate test site on port 8891, so it never touches your development site. Pass ARGS="--filter test_name" to run some of it.

  • make test-js runs the JavaScript tests in tests/js with Node's built-in test runner.

  • make status shows whether this checkout's sites are running, their URLs, and the install path, whose name the containers start with.

  • Each checkout gets its own containers, named after its directory. To run a second checkout, such as a git worktree, at the same time, give it other ports in two gitignored files, which every make target then uses:

    echo '{ "port": 8892 }' > .wp-env.override.json
    echo '{ "port": 8893 }' > .wp-env.tests.override.json
    

    For a one-off, WP_ENV_PORT and WP_ENV_TESTS_PORT override them, e.g. WP_ENV_PORT=8894 make up.

  • make lint runs PHP CodeSniffer on the lines you changed since trunk. make lint-all checks every file.

Releasing

The release scripts are shared with other plugins, so scripts/prepare-release.mjs, scripts/create-release.mjs and scripts/RELEASE_PR_TEMPLATE.md.mjs are the same in all of them. Settings for this plugin are in release.config.json.

  1. Create a milestone named after the version, and add the merged pull requests to it.
  2. Check "Tested up to" in syntaxhighlighter.php and readme.txt. WordPress.org shows the one in syntaxhighlighter.php.
  3. Run make release VERSION=x.y.z on trunk. It updates the version and opens a release pull request.
  4. Edit the release notes in the pull request's description. They become the changelog entry.
  5. Merge it. That publishes the plugin: the workflow writes the changelog, creates the tag and the GitHub release, and commits the plugin to WordPress.org.

readme.txt keeps the five newest changelog entries, and the workflow deletes the oldest one. Copy that one to changelog.txt in the release pull request to keep it.

The workflow needs two repository secrets: WORDPRESSORG_SVN_USERNAME and WORDPRESSORG_SVN_PASSWORD.

Block Development Workflow

Source code is located in the src folder.

When making changes to the block:

  • Run make start (npm start) to build a development version with file watching.
  • Run make build (npm run build) to build a minified production file.

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…