Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add code snippet in your Blazor pages for 196 programming languages with 243 styles

NotificationsYou must be signed in to change notification settings

erossini/BlazorCodeSnippet

Repository files navigation

This is a Blazor component to show code in a nice way usinghighlight.jsBlazor WebAssembly andBlazor Server.The component is usinghighlight.js.

Usage

In yourIndex.html or_Host add this line

<script src="/_content/PSC.Blazor.Components.CodeSnippet/codesnippet.js"></script>

Then, in your_Imports.razor add this line

@using PSC.Blazor.Components.CodeSnippet

Based on the parameters, the component adds automatically the required scripts and CSS in your page.

Add a CodeSnippet

For example, I want to add a C# code with the *Visual Studio Style. Between the CodeSnippet tag, you have to add the code you want to show. This is the code.

<CodeSnippet Language="Language.csharp">protected override async Task OnAfterRenderAsync(bool firstRender){    await _js.InvokeVoidAsync("loadJs", targetUrl);}</CodeSnippet>

Then, I want to add a new CodeSnippet using XML and the style ofAndroid Studio. You have to replace special characters like < (&lt;) with the corrispondent HTML code.If you have multipleCodeSnippet in the same pag, you can avoid to load multiple times thehighlight.js setting tofalse the parameterLoadMainScript.

<CodeSnippet Language="Language.xml" LoadMainScript="false">&lt;CodeSnippet Language="Language.xml">&lt;/CodeSnippet></CodeSnippet>

Supported languages

LanguageScript
1c1c.min.js
abnfabnf.min.js
accesslogaccesslog.min.js
actionscriptactionscript.min.js
adaada.min.js
angelscriptangelscript.min.js
apacheapache.min.js
applescriptapplescript.min.js
arcadearcade.min.js
arduinoarduino.min.js
armasmarmasm.min.js
asciidocasciidoc.min.js
aspectjaspectj.min.js
autohotkeyautohotkey.min.js
autoitautoit.min.js
avrasmavrasm.min.js
awkawk.min.js
axaptaaxapta.min.js
bashbash.min.js
basicbasic.min.js
bnfbnf.min.js
brainfuckbrainfuck.min.js
cc.min.js
calcal.min.js
capnprotocapnproto.min.js
ceylonceylon.min.js
cleanclean.min.js
clojure-replclojure-repl.min.js
clojureclojure.min.js
cmakecmake.min.js
coffeescriptcoffeescript.min.js
coqcoq.min.js
coscos.min.js
cppcpp.min.js
crmshcrmsh.min.js
crystalcrystal.min.js
csharpcsharp.min.js
cspcsp.min.js
csscss.min.js
dd.min.js
dartdart.min.js
delphidelphi.min.js
diffdiff.min.js
djangodjango.min.js
dnsdns.min.js
dockerfiledockerfile.min.js
dosdos.min.js
dsconfigdsconfig.min.js
dtsdts.min.js
dustdust.min.js
ebnfebnf.min.js
elixirelixir.min.js
elmelm.min.js
erberb.min.js
erlang-replerlang-repl.min.js
erlangerlang.min.js
excelexcel.min.js
fixfix.min.js
flixflix.min.js
fortranfortran.min.js
fsharpfsharp.min.js
gamsgams.min.js
gaussgauss.min.js
gcodegcode.min.js
gherkingherkin.min.js
glslglsl.min.js
gmlgml.min.js
gogo.min.js
gologolo.min.js
gradlegradle.min.js
groovygroovy.min.js
hamlhaml.min.js
handlebarshandlebars.min.js
haskellhaskell.min.js
haxehaxe.min.js
hsphsp.min.js
httphttp.min.js
hyhy.min.js
inform7inform7.min.js
iniini.min.js
irpf90irpf90.min.js
isblisbl.min.js
javajava.min.js
javascriptjavascript.min.js
jboss-clijboss-cli.min.js
jsonjson.min.js
julia-repljulia-repl.min.js
juliajulia.min.js
kotlinkotlin.min.js
lassolasso.min.js
latexlatex.min.js
ldifldif.min.js
leafleaf.min.js
lessless.min.js
lisplisp.min.js
livecodeserverlivecodeserver.min.js
livescriptlivescript.min.js
llvmllvm.min.js
lsllsl.min.js
lualua.min.js
makefilemakefile.min.js
markdownmarkdown.min.js
mathematicamathematica.min.js
matlabmatlab.min.js
maximamaxima.min.js
melmel.min.js
mercurymercury.min.js
mipsasmmipsasm.min.js
mizarmizar.min.js
mojoliciousmojolicious.min.js
monkeymonkey.min.js
moonscriptmoonscript.min.js
n1qln1ql.min.js
nestedtextnestedtext.min.js
nginxnginx.min.js
nimnim.min.js
nixnix.min.js
node-replnode-repl.min.js
nsisnsis.min.js
objectivecobjectivec.min.js
ocamlocaml.min.js
openscadopenscad.min.js
oxygeneoxygene.min.js
parser3parser3.min.js
perlperl.min.js
pfpf.min.js
pgsqlpgsql.min.js
php-templatephp-template.min.js
phpphp.min.js
plaintextplaintext.min.js
ponypony.min.js
powershellpowershell.min.js
processingprocessing.min.js
profileprofile.min.js
prologprolog.min.js
propertiesproperties.min.js
protobufprotobuf.min.js
puppetpuppet.min.js
purebasicpurebasic.min.js
python-replpython-repl.min.js
pythonpython.min.js
qq.min.js
qmlqml.min.js
rr.min.js
reasonmlreasonml.min.js
ribrib.min.js
roboconfroboconf.min.js
routerosrouteros.min.js
rslrsl.min.js
rubyruby.min.js
ruleslanguageruleslanguage.min.js
rustrust.min.js
sassas.min.js
scalascala.min.js
schemescheme.min.js
scilabscilab.min.js
scssscss.min.js
shellshell.min.js
smalismali.min.js
smalltalksmalltalk.min.js
smlsml.min.js
sqfsqf.min.js
sqlsql.min.js
stanstan.min.js
statastata.min.js
step21step21.min.js
stylusstylus.min.js
subunitsubunit.min.js
swiftswift.min.js
taggerscripttaggerscript.min.js
taptap.min.js
tcltcl.min.js
thriftthrift.min.js
tptp.min.js
twigtwig.min.js
typescripttypescript.min.js
valavala.min.js
vbnetvbnet.min.js
vbscript-htmlvbscript-html.min.js
vbscriptvbscript.min.js
verilogverilog.min.js
vhdlvhdl.min.js
vimvim.min.js
wasmwasm.min.js
wrenwren.min.js
x86asmx86asm.min.js
xlxl.min.js
xmlxml.min.js
xqueryxquery.min.js
yamlyaml.min.js
zephirzephir.min.js

Supported style

StyleCSS file
a11y-darka11y-dark.min.css
a11y-lighta11y-light.min.css
agateagate.min.css
an-old-hopean-old-hope.min.css
androidstudioandroidstudio.min.css
arduino-lightarduino-light.min.css
artaarta.min.css
asceticascetic.min.css
atom-one-dark-reasonableatom-one-dark-reasonable.min.css
atom-one-darkatom-one-dark.min.css
atom-one-lightatom-one-light.min.css
brown-paperbrown-paper.min.css
brown-papersq.pngbrown-papersq.png
codepen-embedcodepen-embed.min.css
color-brewercolor-brewer.min.css
darkdark.min.css
defaultdefault.min.css
devibeansdevibeans.min.css
doccodocco.min.css
farfar.min.css
foundationfoundation.min.css
github-dark-dimmedgithub-dark-dimmed.min.css
github-darkgithub-dark.min.css
githubgithub.min.css
gmlgml.min.css
googlecodegooglecode.min.css
gradient-darkgradient-dark.min.css
gradient-lightgradient-light.min.css
grayscalegrayscale.min.css
hybridhybrid.min.css
ideaidea.min.css
ir-blackir-black.min.css
isbl-editor-darkisbl-editor-dark.min.css
isbl-editor-lightisbl-editor-light.min.css
kimbie-darkkimbie-dark.min.css
kimbie-lightkimbie-light.min.css
lightfairlightfair.min.css
lioshilioshi.min.css
magulamagula.min.css
mono-bluemono-blue.min.css
monokai-sublimemonokai-sublime.min.css
monokaimonokai.min.css
night-owlnight-owl.min.css
nnfx-darknnfx-dark.min.css
nnfx-lightnnfx-light.min.css
nordnord.min.css
obsidianobsidian.min.css
paraiso-darkparaiso-dark.min.css
paraiso-lightparaiso-light.min.css
pojoaque.jpgpojoaque.jpg
pojoaquepojoaque.min.css
purebasicpurebasic.min.css
qtcreator-darkqtcreator-dark.min.css
qtcreator-lightqtcreator-light.min.css
rainbowrainbow.min.css
routerosrouteros.min.css
school-bookschool-book.min.css
shades-of-purpleshades-of-purple.min.css
srcerysrcery.min.css
stackoverflow-darkstackoverflow-dark.min.css
stackoverflow-lightstackoverflow-light.min.css
sunburstsunburst.min.css
tomorrow-night-bluetomorrow-night-blue.min.css
tomorrow-night-brighttomorrow-night-bright.min.css
vsvs.min.css
vs2015vs2015.min.css
xcodexcode.min.css
xt256xt256.min.css

Examples

CSharp (Visual Studio style)

CSharp with Code Snippet for Blazor

Java (Android Studio style)

Java with Code Snippet for Blazor

Swift (XCode style)

Swift with Code Snippet for Blazor


Other Blazor components

Component nameForumDescription
DataTable for BlazorForumDataTable component for Blazor WebAssembly and Blazor Server
Markdown editor for BlazorForumThis is a Markdown Editor for use in Blazor. It contains a live preview as well as an embeded help guide for users.
CodeSnipper for BlazorForumAdd code snippet in your Blazor pages for 196 programming languages with 243 styles
Copy To ClipboardForumAdd a button to copy text in the clipbord
SVG Icons and flags for BlazorForumLibrary with a lot of SVG icons and SVG flags to use in your Razor pages
Modal dialog for BlazorForumSimple Modal Dialog for Blazor WebAssembly
PSC.ExtensionsForumA lot of functions for .NET5 in a NuGet package that you can download for free. We collected in this package functions for everyday work to help you with claim, strings, enums, date and time, expressions...
Quill for BlazorForumQuill Component is a custom reusable control that allows us to easily consume Quill and place multiple instances of it on a single page in our Blazor application
Segment for BlazorForumThis is a Segment component for Blazor Web Assembly and Blazor Server
Tabs for BlazorForumThis is a Tabs component for Blazor Web Assembly and Blazor Server
WorldMap for BlazorForumForum

More examples and documentation

About

Add code snippet in your Blazor pages for 196 programming languages with 243 styles

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp