ROSTAM2
چهارشنبه 14 شهریور 1403, 16:57 عصر
highlight.js - npm (npmjs.com) (https://www.npmjs.com/package/highlight.js)
بصورت کلی یک فرآیند داره اما رنگ های اون کد بدرستی و کامل نیست: (برای HTML)
156021
<link rel="stylesheet" href="/path/to/styles/default.min.css">
<script src="/path/to/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
برای استفاده کد هم :
<pre><code class="language-html">...</code></pre>
نمونه سند HTML برای VBNET
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link rel="stylesheet" href="./styles/default.min.css">
<script src="./highlight.min.js"></script>
<script>hljs.highlightAll();</script>
<style>
pre , code{
padding: 0px;
padding-left: 10px;
background-color:snow !important;
font-size: 18px !important;
}
</style>
</head>
<body>
<pre><code class="language-vbnet"> Dim Contents As New List(Of String)
Dim WebSiteItem As Websites
Dim Value As String = ""
With My.KeyStoreData
For I = 1 To 50
ChDir(Application.StartupPath)
'Value = String.Format("{3}) FirstName: {4}{0} LastName: {5}{0} UserName: {1}{0} Password: {2}", vbTab,
' IO.Path.GetFileNameWithoutExtension(IO.Path.GetTem pFileName).ToLower,
' Guid.NewGuid.ToString.Replace("-", ""), I,
' IO.Path.GetFileNameWithoutExtension(IO.Path.GetTem pFileName).ToLower.Replace("tmp", "BusinessMan"),
' IO.Path.GetFileNameWithoutExtension(IO.Path.GetTem pFileName).ToLower.Replace("tmp", "Number"))
WebSiteItem = New Websites With {.ID = Guid.NewGuid, .Title = IO.Path.GetFileNameWithoutExtension(IO.Path.GetTem pFileName).ToLower.Replace("tmp", "Number"),
.Address = "BusinessMan",
.UserName = IO.Path.GetFileNameWithoutExtension(IO.Path.GetTem pFileName).ToLower.ToHashedString(ProtectionKey),
.Password = Guid.NewGuid.ToString.Replace("-", "").ToHashedString(ProtectionKey), .Date = Now, .LastModified = Now,
.UserAccount = My.UserAccount.ID, .Mobile = "09360000000".ToHashedString(ProtectionKey), .EMail = "Skip".ToHashedString(ProtectionKey)}
.AddToWebsites(WebSiteItem)
Application.DoEvents()
Next
.SaveChanges(True)
End With
</code></pre>
</body>
</html>
دانلود Highlight.js: (همه زبانهایی که می خواید باید انتخاب و روی کلید Download کلیلک کنید....)
Download a Custom Build - highlight.js (highlightjs.org) (https://highlightjs.org/download)
راهنما:
Highlight.js — highlight.js 11.9.0 documentation (highlightjs.readthedocs.io) (https://highlightjs.readthedocs.io/en/latest/readme.html)
بصورت کلی یک فرآیند داره اما رنگ های اون کد بدرستی و کامل نیست: (برای HTML)
156021
<link rel="stylesheet" href="/path/to/styles/default.min.css">
<script src="/path/to/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
برای استفاده کد هم :
<pre><code class="language-html">...</code></pre>
نمونه سند HTML برای VBNET
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link rel="stylesheet" href="./styles/default.min.css">
<script src="./highlight.min.js"></script>
<script>hljs.highlightAll();</script>
<style>
pre , code{
padding: 0px;
padding-left: 10px;
background-color:snow !important;
font-size: 18px !important;
}
</style>
</head>
<body>
<pre><code class="language-vbnet"> Dim Contents As New List(Of String)
Dim WebSiteItem As Websites
Dim Value As String = ""
With My.KeyStoreData
For I = 1 To 50
ChDir(Application.StartupPath)
'Value = String.Format("{3}) FirstName: {4}{0} LastName: {5}{0} UserName: {1}{0} Password: {2}", vbTab,
' IO.Path.GetFileNameWithoutExtension(IO.Path.GetTem pFileName).ToLower,
' Guid.NewGuid.ToString.Replace("-", ""), I,
' IO.Path.GetFileNameWithoutExtension(IO.Path.GetTem pFileName).ToLower.Replace("tmp", "BusinessMan"),
' IO.Path.GetFileNameWithoutExtension(IO.Path.GetTem pFileName).ToLower.Replace("tmp", "Number"))
WebSiteItem = New Websites With {.ID = Guid.NewGuid, .Title = IO.Path.GetFileNameWithoutExtension(IO.Path.GetTem pFileName).ToLower.Replace("tmp", "Number"),
.Address = "BusinessMan",
.UserName = IO.Path.GetFileNameWithoutExtension(IO.Path.GetTem pFileName).ToLower.ToHashedString(ProtectionKey),
.Password = Guid.NewGuid.ToString.Replace("-", "").ToHashedString(ProtectionKey), .Date = Now, .LastModified = Now,
.UserAccount = My.UserAccount.ID, .Mobile = "09360000000".ToHashedString(ProtectionKey), .EMail = "Skip".ToHashedString(ProtectionKey)}
.AddToWebsites(WebSiteItem)
Application.DoEvents()
Next
.SaveChanges(True)
End With
</code></pre>
</body>
</html>
دانلود Highlight.js: (همه زبانهایی که می خواید باید انتخاب و روی کلید Download کلیلک کنید....)
Download a Custom Build - highlight.js (highlightjs.org) (https://highlightjs.org/download)
راهنما:
Highlight.js — highlight.js 11.9.0 documentation (highlightjs.readthedocs.io) (https://highlightjs.readthedocs.io/en/latest/readme.html)