oik-css

外掛說明

Allows internal CSS styling to be included in the content of the page.

  • Use the CSS block to add custom CSS.
  • Use the GeSHi block to syntax highlight: CSS, HTML, JavaScript, jQuery, PHP, MySQL or None.

For backward compatibility:

  • Use the [bw_css] shortcode to add custom CSS as and when you need it.

For designers, developers and documenters [bw_css] supports echoing of the custom CSS, allowing you to document the CSS you are using.
For readability, the CSS is processed using the Generic Syntax Highlighter (GeSHi) processing.

  • Use the [bw_geshi] shortcode for syntax highlighting of: CSS, HTML(5), JavaScript and jQuery, PHP and MySQL.
    Also supports language: none.

If the oik base plugin is activated

  • Use the [bw_autop] shortcode to disable or re-enable WordPress’s wpautop() logic.

  • Use the experimental [bw_background] shortcode to display an attached image in the background.

Further reading

If you want to read more about the oik plugins then please visit the
oik plugin
“OIK – OIK Information Kit”

螢幕擷圖

  • CSS block example
  • GeSHi block example
  • [bw_css] - syntax and examples
  • [bw_geshi] - examples
  • oik-CSS options - available when oik is active

適用於區塊編輯器

這個外掛提供 2 個可供 Gutenberg/區塊編輯器使用的區塊。

  • CSS Inline CSS
  • GeSHi Generic Syntax Highlighting - for code examples

安裝方式

  1. Upload the contents of the oik-css plugin to the `/wp-content/plugins/oik-css’ directory
  2. Activate the oik-css plugin through the ‘Plugins’ menu in WordPress
  3. Use the CSS and GeSHi blocks within your content.

常見問題集

What are the dependencies?

This code is no longer dependent upon the oik base plugin; it uses shared libraries.
If you want to use the shortcodes then using oik v3.3.7 or higher is still recommended.

What is the syntax?

[bw_css] your CSS goes here [/bw_css]

Note: The ending shortcode tag [/bw_css] is required

How do I get the GeSHi output?

Either

[bw_css .] your CSS goes here[/bw_css]

[bw_css text="Annotation to the CSS that will follow"] your CSS goes here[/bw_css]

How do I get GeSHi output for other languages?

Use the [bw_geshi] shortcode.
e.g.
[bw_geshi html]<h3>[bw_css], [bw_geshi] & [bw_background]</h3><p>Cool, lazy smart shortcodes from oik-plugins.</p>
[/bw_geshi]

Supported languages are:

  • CSS
  • HTML(5)
  • JavaScript and jQuery
  • PHP
  • MySQL
  • none

If you want to display syntax highlighted CSS without affecting the current display use [bw_geshi css].

What version of GeSHi does oik-css use?

oik-css delivers a subset of GeSHi version 1.0.9.0, which was released in May 2017, with modifications to support PHP 7.2

Only a small selection of the languages are supported by oik-css. These are the languages primarily used by WordPress.

Note: oik-css will only load the GeSHi code if it is not already loaded.

What about Gutenberg?

oik-css has been tested with the Gutenberg plugin and some problems were detected.
For details see [github bobbingwide oik-css issues 9].
Changes have been made to undo the unwanted wpautop processing that affected the output of the bw_geshi shortcode.

In the future you may want to convert your shortcodes to blocks.
We are developing a new plugin for this… [github bobbingwide oik-block].
This new plugin depends on Gutenberg, the oik base plugin and oik-css.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈oik-css〉的開發相關工作。

參與者

將〈oik-css〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

2.1.3

  • Changed: Support PHP 8.3 #27
  • Changed: Update wp-scripts and rebuild using separate entry points #26
  • Tested: With WordPress 6.5-RC2 and WordPress Multisite
  • Tested: With PHP 8.3
  • Tested: With PHPUnit 9.6