DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
RF Code Snippet Manager¶
Author: | Kasper Skårhøj |
---|---|
Created: | 2002-11-01T00:32:00 |
Changed by: | Ralf Freit |
Changed: | 2012-02-17T21:35:46 |
Classification: | EXT: rf_snippets |
Keywords: | forEditors, forBeginners, forAdmins |
Author: | Ralf Freit |
Email: | ralf@freit.de |
Language: | en |
RF Code Snippet Manager - EXT: rf_snippets
RF Code Snippet Manager¶
Extension Key: EXT: rf_snippets
Language: en
Copyright 2012, Ralf Freit, <ralf@freit.de>
This document is published underthe Open Content License
available from http://www.opencontent.org/opl.shtml
The content of this document is related to TYPO3
- a GNU/GPL CMS/Framework available from www.typo3.org
Table of Contents¶
`Introduction 3 <#__RefHeading__6956_1606080306>`_
`Administration 6 <#__RefHeading__940_377938794>`_
Settings: TypoScript example 6
`Configuration / Options 8 <#__RefHeading__3420_1871875012>`_
`Autoren 10 <#__RefHeading__1392_1836741660>`_
Authors of the code involved 10
Authors of the languages used in the SyntaxHighlighter 10
`FAQ 11 <#__RefHeading__10458_1843422657>`_
`To-Do list 12 <#__RefHeading__6990_1606080306>`_
`ChangeLog 13 <#__RefHeading__6992_1606080306>`_
List of Figures
Figure 1: Category Overview 3
Figure 2: Category View (all closed) 3
Figure 3: Category View (open) 4
Figure 4: Single View 4
Figure 5: Search result for all fields 5
Introduction¶
What does it do?¶
With this extension it is possible to create a public or even internal area to display own code snippets and/or also to allow users to insert their own code snippets to their database. All code snippets can be provided with supplementary notes and tags which can be browsed later.
Features¶
Every view of the code snippet manager has its own page, which serves to have fully content control, and this allows the editor to deposit different additional information to the every single view.
SyntaxHighlighter integrated with more than 25 languages
It supports the following languages:
ActionScript 3, Bash/shell, ColdFusion, C#, C++, CSS, Delphi, Diff, Erlang, Groovy, JavaScript, Java, JavaFX, Perl, PHP, PlainText, PowerShell, Python, Ruby, Scala, SQL, TypoScript, VisualBasic, XML
Full configuration is possible by combining control and direct configuration from TypoScript and Plugin
Extensive configuration to ensure maximum flexibility
Live Demo¶
Screenshots¶
Figure 2: Category View (all closed)
Figure 1: Category Overview
Figure 3: Category View (open)
Figure 4: Single View
Figure 5: Search result for Tags
Figure 5: Search result for all fields
Administration¶
Installation¶
- Install the extension via extension manager.
- Create 6 Pages and 2 Storage folder
- Pages: Category overview, Category view, Single view, Search result, Page for Snippet Add Form, Thank You Page
- Storage Folder: Data storage for the Snippets, User storage for the fe_users
- Create a new Extension Template an add your configuration in it
Settings: TypoScript example¶
plugin.tx_rfsnippets_pi1 {
##### ------------------- ##
####### General settings ###
##### ------------------- ##
## Location for the records
storage = 210
## Location for the fe_user
userStorage = 50
## Template File
templateFile = EXT:rf_snippets/lib/tpl/template.html
## If disableCSS is set to 1 then the frontend issued any CSS file.
disableCSS = 0
## If disableTabby is set to 1 then the frontend issued the Tabby jQuery file.
disableTabby = 0
## RTE is Experimental
enableRTE = 0
## Here you can specify which view should be represented in the current plugin
## Option: catoverview => Category Overview
## catview => Category View
## single => Single View
pluginView = catoverview
## Date formatting for the entire system
dateFormat = %d.%m.%Y
## Wenn Sie jQuery im noConflictMode nutzen dies aktivieren.
jqueryNoConflict = 1
## Welches Feld aus der fe_users soll als Display name erscheinen?
showname = username
## Welchen Namen soll angezeigt werden wenn der Usernicht verfügbar ist
showguestname = Unbekannt
## Welche Blockzeit in ms soll ein Hit geblickt werden
counterbarrier = 10ms
## Leere Kategorien anzeigen
showEmptyCat = 1
## Leere Code gruppen anzeigen
showEmptyGroup = 1
## Suchfeld anzeigen wenn direkt aufruf
showSearchOnDirect = 0
##### ------------------- ##
###### Single View ###
##### ------------------- ##
single {
## Page to display the code snippet
pid = 207
}
##### ------------------- ##
###### Category Overview ###
##### ------------------- ##
catoverview {
## Page for the category summary
pid = 205
}
##### ------------------- ##
###### Category View ###
##### ------------------- ##
catview {
## Page for the category view
pid = 206
## Category View Item Wrap
item {
wrap = <div class="item">|</div>
}
}
##### ------------------- ##
###### Add Form ###
##### ------------------- ##
addform {
## Page to display the add Form
pid = 209
## Page ID for the Thank-You Page
thxPid = 211
error{
## Additional Error CLass
addErr = error
## Wrap for the Error Information
addErrWrap = '<div class="error">|</div>';
}
}
##### ------------------- ##
###### Searchresult ###
##### ------------------- ##
searchresult {
## Page to display the serarchresult
pid = 208
}
## Here SyntaxHighlighter Configration
sh {
## SyntaxHighlighter deaktivieren
disable = 0
## At what line will be started to count
first-line = 1
## Pads line numbers. Possible values are:
## false - don't pad line numbers.
## true - automaticaly pad numbers with minimum required number of leading zeroes.
## [int] - length up to which pad line numbers.
pad-line-numbers = true
## Lines to highlight.
highlight = 0
## Title to be displayed above the code block.
title = Hint: Doubleklick to mark all
## Enables or disables smart tabs.
smart-tabs = 1
## Gets or sets tab size.
tab-size = 4
## Enables or disables gutter.
gutter = 1
## Enables or disables toolbar.
toolbar = 1
## Enables quick code copy and paste from double click.
quick-code = 1
## Forces code view to be collapsed.
collapse = 0
## Themeswitcher:
## Default shThemeDefault.css
## Django shThemeDjango.css
## Eclipse shThemeEclipse.css
## Emacs shThemeEmacs.css
## FadeToGrey shThemeFadeToGrey.css
## Midnight shThemeMidnight.css
## RDark shThemeRDark.css
themes = Default
}
}
Configuration / Options¶
TypoScript¶
storage¶
Property
storage
Data type
Int
Description
Location for the records
Default
userStorage¶
Property
userStorage
Data type
Int
Description
Location for the fe_user
Default
templateFile¶
Property
templateFile
Data type
String
Description
Template File
Default
EXT:rf_snippets/lib/tpl/template.html
disableCSS¶
Property
disableCSS
Data type
Boolean
Description
If disableCSS is set to 1 then the frontend issues any CSS file.
Default
pluginView¶
Property
pluginView
Data type
String
Description
Here you can specify which view should be represented in the current plugin
a
available options
a
catoverview
b
Category overview
a
catview
b
Category view
a
single
b
Single view
a
result
b
Search result view
a
addform
b
Add form view
a
searchform
b
Search form
a
abcblock
b
ABC block
Default
catoverview
dateFormat¶
Property
dateFormat
Data type
String
Description
Date formating for the entire system ( more Information here )
Default
%d.%m.%Y
jqueryNoConflict¶
Property
jqueryNoConflict
Data type
Boolean
Description
Wenn Sie jQuery im noConflictMode nutzen dies aktivieren.
Default
1
showname¶
Property
showname
Data type
String
Description
Welches Feld aus der fe_users soll als Display Namen erscheinen?
Default
username
showguestname¶
Property
showguestname
Data type
String
Description
Welcher Name soll angezeigt werden wenn der user nicht verfügbar ist
Default
Unbekannt
counterbarrier¶
Property
counterbarrier
Data type
Int
Description
Welche Blockzeit in ms soll ein Hit geblickt werden
Default
3600
showEmptyCat¶
Property
showEmptyCat
Data type
Boolean
Description
Leere Kategorien anzeigen
Default
1
showEmptyGroup¶
Property
showEmptyGroup
Data type
Boolean
Description
Leere Codegruppen anzeigen
Default
1
showSearchOnDirect¶
Property
showSearchOnDirect
Data type
Boolean
Description
Suchfeld anzeigen wenn Direktaufruf
Default
0
single.pid¶
Property
single.pid
Data type
Int
Description
Page to display the code snippet
Default
catoverview.pid¶
Property
catoverview.pid
Data type
Int
Description
Page for the category summary
Default
catview.pid¶
Property
catview.pid
Data type
Int
Description
Page for the category view
Default
Catview.item.wrap¶
Property
Catview.item.wrap
Data type
String
Description
Category view item wrap
Default
<div class="item">|</div>
addform.pid¶
Property
addform.pid
Data type
Int
Description
Page to display the add form
Default
addform.thxPid¶
Property
addform.thxPid
Data type
Int
Description
Page ID for the Thank-You-page
Default
addform.error.addErr¶
Property
addform.error.addErr
Data type
String
Description
Additional error class
Default
error
addform.error.addErrWrap¶
Property
addform.error.addErrWrap
Data type
String
Description
Wrap for the error information
Default
<div class="error">|</div>
Searchresult.pid¶
Property
Searchresult.pid
Data type
Int
Description
Page to display the search result
Default
sh.disable¶
Property
sh.disable
Data type
Description
SyntaxHighlighter deaktivieren
Default
0
sh.first-line¶
Property
sh.first-line
Data type
Description
At what line will be started to count
Default
1
sh.pad-line-numbers¶
Property
sh.pad-line-numbers
Data type
Int / Boolean
Description
Pads line numbers. Possible values are:
a
available options
a
false
b
don't pad line numbers.
a
true
b
automatically pad numbers with minimum required number of leading zeroes.
a
int
b
length up to which pad line numbers.
Default
true
sh.highlight¶
Property
sh.highlight
Data type
Int
Description
Lines to highlight.
Default
sh.title¶
Property
sh.title
Data type
String
Description
Title to be displayed above the code block.
Default
Hint: Doubleklick to mark all
sh.smart-tabs¶
Property
sh.smart-tabs
Data type
Boolean
Description
Enables or disables smart tabs.
Default
1
sh.tab-size¶
Property
sh.tab-size
Data type
Int
Description
Gets or sets tab size.
Default
4
sh.gutter¶
Property
sh.gutter
Data type
Boolean
Description
Enables or disables gutter.
Default
1
sh.toolbar¶
Property
sh.toolbar
Data type
Boolean
Description
Enables or disables toolbar.
Default
1
sh.quick-code¶
Property
sh.quick-code
Data type
Boolean
Description
Enables quick code copy and paste from double click.
Default
1
sh.collapse¶
Property
sh.collapse
Data type
Boolean
Description
Forces code view to be collapsed.
Default
0
sh.themes¶
Property
sh.themes
Data type
String
Description
Du kannst die Styles anpassen oder verändern, du findest sie alle unter EXT:rf_snippets/lib/sh/styles/
a
available options
b
a
Default
b
shThemeDefault.css
a
Django
b
shThemeDjango.css
a
Eclipse
b
shThemeEclipse.css
a
Emacs
b
shThemeEmacs.css
a
FadeToGrey
b
shThemeFadeToGrey.css
a
Midnight
b
shThemeMidnight.css
a
RDark
b
shThemeRDark.css
Default
Default
[tsref:plugin.tx_rfsnippets_pi1]
Autoren¶
Authors of the languages used in the SyntaxHighlighter¶
Name¶
a
Name
b
Autor
c
Link
AppleScript¶
ActionScript 3¶
Bash/shell¶
a
Bash/shell
b
c
ColdFusion¶
a
ColdFusion
b
Jen
c
http://www.jensbits.com/2009/05/14/coldfusion-brush-for- syntaxhighlighter-plus
C#¶
a
C#
b
c
C++¶
a
C++
b
YoungJin
c
CSS¶
a
CSS
b
c
Delphi¶
a
Delphi
b
c
Diff¶
a
Diff
b
c
Erlang¶
Groovy¶
JavaScript¶
a
JavaScript
b
c
Java¶
a
Java
b
c
JavaFX¶
a
JavaFX
b
Patrick Webster
c
http://patrickwebster.blogspot.com/2009/04/javafx-brush-for- syntaxhighlighter.html
Perl¶
a
Perl
b
David Simmons-Duffin and Marty Kube
c
PHP¶
a
PHP
b
c
PlainText¶
a
PlainText
b
c
PowerShell¶
a
PowerShell
b
B.v.Zanten, Getronics
Python¶
a
Python
b
Gheorghe Milas and Ahmad Sherif
c
Ruby¶
a
Ruby
b
Erik Peterson.
c
Scala¶
a
Scala
b
Yegor Jbanov and David Bernard.
c
SQL¶
a
SQL
b
c
TypoScript¶
VisualBasic¶
a
VisualBasic
b
c
XML¶
a
XML
b
c
FAQ¶
You have to ask?¶
Visit my Website: http://www.disegio.de
To-Do list¶
Please see EXT:rf_snippets/README.txt