Linux 软件免费装
Banner图

codeSnips

开发者 obrienlabs
更新时间 2017年11月11日 23:46
捐献地址: 去捐款
PHP版本: 3.9 及以上
WordPress版本: 4.9
版权: GPLv2 or later
版权网址: 版权信息

标签

post embed shortcode admin php snippets list code custom archive library snippet syntax highlight highlighting raw

下载

1.1.3 1.1.4 1.1.5 1.1.6 1.2 1.0 1.0.1 1.0.2 1.1 1.1.1 1.1.2

详情介绍:

Own your snippets! No longer require the use of a cloud service to host your snippets for you when you can host them right on your own WordPress site! codeSnips allows you to quickly add and embed code snippets to your website with syntax highlighting available for 124 languages! codeSnips uses custom post types where you create a new snippet post, select the programming language, enter the code snippet and publish the post. You then can either access the snippet post directly for sharing, or embed it into another post using the shortcode. View all of your snippets in an archived list, or even on the snippet page itself - without embedding into a new post. You can access all your snippets using a customizable pretty URL permalink. For example: http://yoursite.com/snippets You can also view the raw plain text snippet directly, which is ideal for copy & pasting. Features: The default list of snippets will display as a post archive list using your theme. You can customize the way this list looks by simply adding a file in your theme called "archive-snippets.php". Likewise, if you add a theme file called "single-snippets.php" it allows you to customize the way the direct snippet pageis rendered. There are examples located included with the plugin under the "templates" folder.

安装:

Install Installing codeSnips can be done from inside your WordPress admin panel by going to Plugins > Add New and searching for "codeSnips".
  1. You can also manually install it by downloading the plugin from wordpress.org/plugins
  2. Upload the entire codesnips folder to the /wp-content/plugins/ directory
  3. 通过WordPress的“插件”菜单激活插件
  4. Customize the plugin from the menu by selecting codeSnips > Settings.
Uninstall
  1. Deactivate the plugin from the Plugins menu
  2. Select "codeSnips" from the list and select "Delete"
  3. This will delete all files from the server and all settings from the WordPress database.

屏幕截图:

  • Snippets embedded in a post.
  • List of all snippets in an archive list. The list can be customized to your theme.
  • The direct snippet post itself. Not embedded.
  • List of all snippets in wp-admin.
  • Editing an existing snippet post type.
  • General settings page for codeSnips.
  • Editor specific settings for the Ace Editor.
  • Usage tips to help out.

升级注意事项:

1.2 This upgrade brings an upgrade to the new Ace Editor, some minor style and code fixes. 1.1.6 New update where all new snippets will have "Show Snippet Description" enabled. Fixed a bug where the snippet slug was being reset to default. 1.1.5 Fixes another small bug found with CPT post update messages. 1.1.4 Fixed a small bug with the CPT post update messages. 1.1.3 Added Jetpack Markdown capability in the snippet description. Fixed missing language settings, too. 1.1.2 Some changes to the plugin's Settings page structure 1.1.1 Removed some CSS from admin.css, which was altering items it didn't need to. 1.1 Added internationalization options for the text fields. Interested in translating this plugin? Let me know! 1.0.2 Further updates on how the custom post type sample URL is being displayed on the General Settings page. 1.0.1 Found a small bug with the custom post type URL being displayed incorrectly on the General Settings page. 1.0 Initial.

常见问题:

How do I embed a snippet into my post?

It's easy. Once you've created your snippet, you need to know the snippet ID. Easiest way is to go back to the "All Snippets" page in the Admin Dashboard. Then just copy and paste the shortcode that's next to your post. For example, you would copy [snippet id=5] to your post, and that's it!

Can I have private or password protected snippets?

You can! Just set the status of the post when you create your snippet. An important item to understand is that if your snippet is password protected or private, then it will not show when you use the shortcode. The snippet will also not be available in the view raw mode.

What if I want to hide (or show) the snippet meta bar?

The snippet meta bar is enabled by default. The meta bar contains the filename and the code language. If you want to disable the snippet bar globally, you can do so in the codeSnips Settings page. Likewise, if you want to disable it for just a single snippet embed at a time, you can add meta="false" to your shortcode. For example, [snippet id="15" meta="false"] would show the snippet ID 15 with the description but no meta bar.

What if I want to show the snippet description?

The descriptions are disabled by default. To enable them, you must type in a description in the snippet edit page, then check the checkbox for it to display on the single snippet post. To add a description for an embedded post, just add desc="true" to your shortcode. For example, [snippet id=20 desc="true"] would show the snippet ID 20 and it's description if it had one.

How do I change the look of the snippet box?

Just edit the frontend.css file located under CSS folder. You can remove the border, or even change the way the gutter and everything looks (without changing the built-in editor Themes)

How many options are available using the shortcode?

You can see all the documented options under the codeSnips > Settings menu, then select the Usage tab.

Can I help you translate the plugin?

Yes please! As of 1.1 the POT file is available. If you translate it, let me know and I'll include it in a maintenenace release!

更新日志:

1.2 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1 1.0.2 1.0.1 1.0