Yet Another Web Framework
Shopping Cart
LoginLogin
  • User
    • Settings
      Settings
      Login
      Login
      Register
      Register
  • Documentation
    • News
      News
      Upcoming Features
      Upcoming Features
      YetaWF Documentation
      YetaWF Documentation
      Comodo Trust Logo
      Comodo Trust Logo
      Email Authentication
      Email Authentication
      Google Adwords
      Google Adwords
      Google Authentication
      Google Authentication
      Link Previews
      Link Previews
      Nexmo Processor
      Nexmo Processor
      SMS Authentication
      SMS Authentication
      Twilio Processor
      Twilio Processor
  • Blog
  • Demo
  • Store
Login
Slider
post

A new open source
web framework

ASP.NET Core MVC
and ASP.NET 4

  • Index
  • Search
(None)
  • What is YetaWF?
    • YetaWF Philosophy
  • Installing YetaWF
    • Installing YetaWF From The GitHub Repository
    • Installing YetaWF For ASP.NET Core
    • Installing YetaWF For ASP.NET 4
    • Installing YetaWF Tools & Templates
    • Installing IIS
    • Nuget Package Restore
  • Upgrading YetaWF
    • Upgrading In Development
  • Deploying YetaWF
    • Shared Hosting
    • Private Hosting
    • Azure Web App
    • Blue/Green Deployment
  • Using YetaWF
    • Superuser
    • Site Edit Mode
    • Control Panel
    • Authorization
    • Authentication
    • Page Templates
    • Static Pages
    • Unified Page Sets
    • Site Map
    • Module Reference
    • National Language Support
    • Site Templates
    • Customizing Files
    • Variable Substitution
    • Appsettings.json
    • MimeSettings.json
    • Adding A New Site
  • Development
    • YetaWF on GitHub
    • New Projects, Packages, Modules and Skins
      • Create A New Skin
        • Skin Definition
    • Site Structure
    • Property Lists
    • Published ModuleGuid
    • Grid Layout File
    • Css Addons
      • Styling A Module
      • Css Classes
    • Javascript Addons
    • Image Http Handler
    • ModuleAction
      • Sprites
    • Development Tools
    • Testing Tools
    • Templates
      • Creating Your Own Templates
      • YetaWF Templates
        • ActionIcons
        • Boolean
        • CountryISO3166
        • Currency
        • Date
        • DateTime
        • Decimal
        • DropDownList
        • DropDownListInt
        • Email
        • Enum
        • FileSize
        • FloatValue
        • FileUpload
        • Grid
        • Guid
        • Hidden
        • Image
        • IntValue, 2, 4, 6
        • IPAddress
        • JQueryUISkin
        • KendoUISkin
        • LanguageId
        • ListOfStrings
        • LongValue
        • ModuleAction
        • ModuleActions
        • ModuleSelection
        • ModuleSkins
        • MultiString, 10, 20, 40, 80
        • PageDefinitions
        • PageSkin
        • PaneSelection
        • Password20
        • PopupSkin
        • PropertyList
        • PropertyListTabbed
        • Raw
        • RawBool
        • RawInt
        • Recaptcha
        • RecaptchaV2
        • ReferencedModules
        • Scroller
        • SMTPServer
        • String
        • StringTT
        • Text, 10, 20, 40, 80
        • TextArea
        • TextAreaSimple
        • TimeSpan
        • TimeZone
        • Url
        • USState
        • YetaWF_Blog_Category
        • YetaWF_Blog_Gravatar
        • YetaWF_CurrencyConverter_Country
        • YetaWF_Identity_Email
        • YetaWF_Identity_LoginUsers
        • YetaWF_Identity_ResourceRoles
        • YetaWF_Identity_ResourceUsers
        • YetaWF_Identity_RoleId
        • YetaWF_Identity_UserId
        • YetaWF_Identity_UserRoles
        • YetaWF_ImageRepository_FlashSelection
        • YetaWF_ImageRepository_ImageSelection
        • YetaWF_Menus_Menu
  • Features
    • Visitor Logging
      • Click Tracking
  • Troubleshooting
    • Defeat Browser/Server Caching
    • Panic Mode - I Can't Log In
    • Browser Lag
    • IntelliSense Isn't Working
    • Visual Studio Templates
  • Packages
    • Softelvdm.IVR Package
    • Softelvdm.TwilioProcessor Package
    • YetaWF.AddThis Package
    • YetaWF.Backups Package
    • YetaWF.Basics Package
    • YetaWF.Blog Package
    • YetaWF.BootstrapCarousel Package
    • YetaWF.Core Package
    • YetaWF.CurrencyConverter Package
    • YetaWF.Dashboard Package
    • YetaWF.DevTests Package
    • YetaWF.Feed Package
    • YetaWF.Feedback Package
    • YetaWF.Identity Package
    • YetaWF.IFrame Package
    • YetaWF.ImageRepository Package
    • YetaWF.KeepAlive Package
    • YetaWF.Languages Package
    • YetaWF.Lightbox Package
    • YetaWF.Logging Package
    • YetaWF.Menus Package
    • YetaWF.ModuleEdit Package
    • YetaWF.Modules Package
    • YetaWF.Packages Package
    • YetaWF.PageEar Package
    • YetaWF.PageEdit Package
    • YetaWF.Pages Package
    • YetaWF.Panels Package
    • YetaWF.Scheduler Package
    • YetaWF.Search Package
    • YetaWF.Security Package
    • YetaWF.SiteProperties Package
    • YetaWF.Sites
    • YetaWF.SyntaxHighlighter Package
    • YetaWF.TawkTo Package
    • YetaWF.Text Package
    • YetaWF.TinyLanguage Package
    • YetaWF.TinyLogin Package
    • YetaWF.UserProfile Package
    • YetaWF.UserSettings Package
    • YetaWF.Visitors Package
  • License
    • YetaWF License
    • Third Party Products
      • ComponentsHTML Addons
      • Core Addons
      • Module Addons

YetaWF Documentation

Display
Print

YetaWF.SyntaxHighlighter Package

Overview

This package implements syntax highlighting in modules.

Formats <pre> .. </pre> sections automatically using either highlight.js or Alex Gorbatchev's Syntax Highlighter.

Syntax Highlighter Settings Module

This is the main configuration module for syntax highlighting. It is accessible using Admin > Configuration > Syntax Highlighter Settings (standard YetaWF site). It is used to define the appearance of sections using syntax highlighting.

Syntax Highlighter Highlight.js (Skin) Module

This module can be referenced by sites, pages or modules, in which case <pre> .. </pre> sections are formatted using highlight.js. This module, implemented by class YetaWF.Modules.SyntaxHighlighter.Modules.SkinHighlightJSModule, has a published ModuleGuid("25068AC6-BA74-4644-8B46-9D7FEC291E45").

The appearance of the <pre> .. </pre> sections using syntax highlighting can be defined using Syntax Highlighter Settings accessible using Admin > Configuration > Syntax Highlighter Settings (standard YetaWF site), Highlight.js tab.

Syntax highlighting can be configured on each <pre> or <code> Html tag. Additional information about configuring syntax highlighting can found at https://highlightjs.org/.

The following languages are currently available (language names are available at http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html#language-names-and-aliases):

LanguageLanguage Names (Css Class)
Apacheapache, apacheconf
Bashbash, sh, zsh
C#cs, csharp
C++cpp, c, cc, h, c++, h++, hpp
CSScss
CoffeeScriptcoffeescript, coffee, cson, iced
Diffdiff, patch
HTML, XMLxml, html, xhtml, rss, atom, xjb, xsd, xsl, plist
HTTPhttp, https
Iniini
JSONjson
Javajava, jsp
JavaScriptjavascript, js, jsx
Makefilemakefile, mk, mak
Markdownmarkdown, md, mkdown, mkd
Nginxnginx, nginxconf
Objective-Cobjectivec, mm, objc, obj-c
PHPphp, php3, php4, php5, php6
Perlperl, pl, pm
Pythonpython, py, gyp
Rubyruby, rb, gemspec, podspec, thor, irb
SQLsql
Shell Sessionshell, console

Highlight.js uses the defined Css class to determine the language (using one of the language names, optionally prefixed by language- or lang-). The language name can be omitted, in which case highlight.js will detect the language automatically. The Css class "lang-nohighlight" can be used to turn off highlighting so highlight.js doesn't automatically determine the language.

Example

<pre class="language-js">
function somejavascript() {
    var x = 20;
    x += 10;
    return x;
}
</pre>
function somejavascript() {
    var x = 20;
    x += 10;
    return x;
}

Adding/Removing Languages

It is possible to add and remove languages by downloading a custom version of highlight.js at https://highlightjs.org/download/. Select/deselect all desired languages and download. Extract highlight.pack.js from the downloaded Zip file and place it into the folder shown below (which may need to be created).

Replace domain.com with the name of the domain. Each site within one YetaWF instance can have its own set of languages and is not shared.

ASP.NET Core
.\Website\wwwroot\AddonsCustom\domain.com\YetaWF\SyntaxHighlighter\_Addons\SkinHighlightJS
ASP.NET 4
.\Website\AddonsCustom\domain.com\YetaWF\SyntaxHighlighter\_Addons\SkinHighlightJS

Syntax Highlighter Alex Gorbatchev (Skin) Module

This module can be referenced by sites, pages or modules, in which case <pre> .. </pre> sections are formatted using Alex Gorbatchev's Syntax Highlighter. This module, implemented by class YetaWF.Modules.SyntaxHighlighter.Modules.SyntaxHighlighterModule, has a published ModuleGuid("7e3c4322-5bdb-44bf-acff-f62d498705ee").

The appearance of the <pre> .. </pre> sections using syntax highlighting can be defined using Syntax Highlighter Settings accessible using Admin > Configuration >Syntax Highlighter Settings (standard YetaWF site), Alex Gorbatchev tab.

Syntax highlighting can be configured on each <pre> Html tag. Additional information about configuring syntax highlighting can found at http://alexgorbatchev.com/SyntaxHighlighter/manual/configuration/).

The following brushes are currently available:

LanguageBrush (Css Class)
C++cpp
C#csharp
Csscss
Javascriptjscript, js
Sqlsql
Visual Basicvb
Xmlxml

Example

<pre class="brush:js">
function somejavascript() {
    var x = 20;
    x += 10;
    return x;
}
</pre>
function somejavascript() {
    var x = 20;
    x += 10;
    return x;
}

License

The YetaWF.Syntax Highlighter package is part of YetaWF, an open source product licensed under the GNU General Public License, version 3 (GPL-3.0) - Copyright - Softel vdm, Inc.


Last Updated 05/15/2018 - (email)
© 2018 - Softel vdm, Inc. - YetaWF.com

YetaWF.com - © Copyright 2019 Softel vdm, Inc.

OnOn
OffOff