Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 亚洲国产中文字幕在线观看,最近中文字幕最新2019免费,中文字幕一级毛片

          整合營銷服務(wù)商

          電腦端+手機(jī)端+微信端=數(shù)據(jù)同步管理

          免費咨詢熱線:

          一鍵生成通用高亮代碼塊到剪貼板,可粘貼到在線編輯器

          些在線圖文編輯器不支持直接插入代碼塊,但可以直接粘貼 HTML 格式的高亮代碼塊。

          花了一點時間研究了一下各家的編輯器,規(guī)則卻各不相同。有的要求代碼塊被包含于 <code> ... </code> 或者 <pre> <code> ... </code> </pre> , 有些要求 class 屬性里包含 "code" 關(guān)鍵詞,或者要求代碼塊里必須包含至少一個 <br> 。如果不符合這些要求,不是變成普通文本,就是丟失換行縮進(jìn),或者丟失顏色樣式。

          所以,這就難了。先得找個支持代碼高亮的編輯器,仔細(xì)地選擇并復(fù)制代碼塊,復(fù)制完還得編輯剪貼板里的 HTML 。這就不如干脆寫個轉(zhuǎn)換工具了。

          因為瀏覽器操作系統(tǒng)剪貼板可能不太方便,下面用 aardio 寫一個工具軟件。

          先看軟件成品演示:

          軟件用法:

          1、輸入編程語言名稱(支持自動完成)。

          2、然后在輸入框中粘貼要轉(zhuǎn)換的編程代碼。

          3、點擊「復(fù)制高亮代碼塊」按鈕。

          然后我們就可以打開在線圖文編輯器直接粘貼生成的高亮代碼塊了。

          下面是這個軟件的 aardio 源代碼:

          import win.ui;
          /*DSG{{*/
          var winform = win.form(text="HTML 代碼塊生成工具 - 本工具使用 aardio 語言編寫";right=1055;bottom=674;bgcolor=16777215)
          winform.add(
          button={cls="button";text="復(fù)制高亮代碼塊";left=633;top=609;right=1000;bottom=665;bgcolor=16777215;color=14120960;db=1;dr=1;font=LOGFONT(h=-14);note="可在網(wǎng)頁編輯器直接粘貼";z=4};
          cmbLangs={cls="combobox";left=262;top=625;right=446;bottom=651;db=1;dl=1;edge=1;items={"javascript"};mode="dropdown";z=2};
          editCode={cls="edit";left=1;top=4;right=1052;bottom=599;db=1;dl=1;dr=1;dt=1;edge=1;hscroll=1;multiline=1;vscroll=1;z=5};
          static={cls="static";text="請選擇語言:";left=70;top=629;right=248;bottom=649;align="right";db=1;dl=1;transparent=1;z=3};
          webCtrl={cls="custom";text="自定義控件";left=8;top=10;right=1048;bottom=604;db=1;dl=1;dr=1;dt=1;hide=1;z=1}
          )
          /*}}*/
          
          import web.view;
          var wb = web.view(winform.webCtrl);
          
          import win.clip.html;
          wb.export({ 
              onHighlight = function(html,background,foreground){
                  html = `<pre class="code" style="overflow-x:auto;text-align:left;box-shadow: rgba(216, 216, 216, 0.5) 0px 0px 0px 1px inset;padding:10px;border-radius:3px;background-color:`+background+`;color:`+foreground+`;white-space:pre;word-break:break-all;display:block;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps: normal;font-family: "Consolas", Consolas, "Liberation Mono", Menlo, Courier, monospace"><code>`
                      + html + `</code></pre>`;
          
                  html,count = string.replace(html,'\n',"<br>");
                  if(!count){
                      html = string.replace(html,`\</code\>\</pre\>$`,`<br></code></pre>`);
                  }
                  var cb = win.clip.html();
                  cb.write(html); 
          
                  winform.setTimeout( 
                      function(){
                          winform.editCode.show(true);
                          winform.webCtrl.show(false);
                          winform.text = "HTML 代碼塊生成工具 - 已復(fù)制高亮代碼塊到剪貼板,可在網(wǎng)頁直接粘貼";
                      },1000); 
              };
              setLanguages = function(langs){
                  winform.languages = langs;
              }  
          })
          
          
          winform.cmbLangs.onEditChange = function(){ 
          
              var text = string.lower(winform.cmbLangs.text);
              var items = table.filter( winform.languages : {}, lambda(v) string.startWith(v,text) ); 
              winform.cmbLangs.autoComplete(items);  
          }
          winform.cmbLangs.editBox.disableInputMethod();
          
          import web.prism;
          import wsock.tcp.asynHttpServer;
          var httpServer = wsock.tcp.asynHttpServer(); 
          httpServer.run(web.prism,{
              ["/index.html"] = /*****
          <!DOCTYPE html>
          <html>
            <head>
              <meta charset="UTF-8" /> 
              <link href="prism.css" rel="stylesheet" />
            </head>
            <body>
              <pre id="code-pre"><code id="code" class="lang-javascript"></code></pre>
              <script src="prism.js"></script>
              <script>
             function computedColorStyle(element, options = {}) {
          
                  Array.prototype.forEach.call(element.children,child => {
                      computedColorStyle(child, options);
                  });
          
                  const computedStyle = getComputedStyle(element);
                  element.style["color"] = computedStyle.getPropertyValue("color");  
              }
          
              highlight = function(code,language){
                  var html = Prism.highlight(code, Prism.languages[language], language);
          
                  var codeEle = document.getElementById("code");
                  codeEle.innerHTML = html;
                  computedColorStyle(codeEle);
          
                  const computedStyle = getComputedStyle(codeEle);  
                  onHighlight(codeEle.innerHTML
                      ,getComputedStyle(document.getElementById("code-pre")).getPropertyValue("background-color")
                      ,computedStyle.getPropertyValue("color"));
              }
          
              setLanguages( Object.keys(Prism.languages) );
              </script>
            </body> 
          </html> 
              *****/
          });
          
          wb.go( httpServer.getUrl("/index.html"));
          
          winform.button.oncommand = function(id,event){
              winform.text = "HTML 代碼塊生成工具 - 本工具使用 aardio 語言編寫"
              winform.editCode.show(false);
              winform.webCtrl.show(true);
          
              wb.xcall("highlight",winform.editCode.text,winform.cmbLangs.text);
          }
          
          
          winform.show();
          win.loopMessage();

          打開 aardio 創(chuàng)建工程,然后復(fù)制粘貼上面的代碼到 main.aardio 里面就可以直接運行,或生成獨立 EXE 文件:

          這個軟件的原理:

          1、首先通過 WebView2 調(diào)用 Prism.js 高亮代碼。為了可以內(nèi)存加載 Prism.js ( 支持生成獨立 EXE ),我寫了一個 aardio 擴(kuò)展庫 web.prism 。關(guān)于 WebView2 請參考:放棄 Electron,擁抱 WebView2!JavaScript 快速開發(fā)獨立 EXE 程序

          2、因為 Prism.js 生成的 HTML 代碼塊都是使用 class 屬性指定樣式,所以我們需要調(diào)用 getComputedStyle 獲取最終渲染的字體顏色屬性。

          3、最后在 JavaScript 里調(diào)用 aardio 函數(shù)處理生成的 HTML 代碼塊,aardio 的任務(wù)是將 HTML 修改為更合適直接粘貼的格式,并盡可能地處理各圖文編輯器的兼容問題。然后調(diào)用 win.clip.html 將處理好的 HTML 復(fù)制到系統(tǒng)剪貼板:

          import win.clip.html;
          
          var cb = win.clip.html();
          cb.write(html); 

          然后只要愉快地粘貼代碼塊就可以。

          如果是 aardio 代碼不需要用這個工具,在 aardio 編輯器里右鍵直接點『 復(fù)制全部到 HTML 代碼塊 』就可以了:

          定程序員是否加班的關(guān)鍵因素之一,是編碼水平。工欲善其事,必先利其器,每一位程序員都有私藏的編程必備工具。今天,緯創(chuàng)軟件的程序員小哥哥給大家分享了5款超好用的代碼比較工具,可以有效提升編碼速度哦!

          一:Beyond Compare

          Beyond Compare這款工具,讓兩份源代碼之間的異同一目了然,字節(jié)用不同的顏色顯示,同時可設(shè)置多種不同的比較規(guī)則,文本文件可以用語法高亮和設(shè)置的比較規(guī)則進(jìn)行編輯對比,適用于用于文檔、源代碼和HTML。這種突出顯示異同的方式,讓源代碼的比較工作異常清晰。

          二、Diffuse

          Diffuse這款工具的命令執(zhí)行速度是非??斓?,C++、Python、Java、XML等語言的語法支持高亮顯示,非常直觀的可視化比較,同時支持三者的源代碼比較。

          三、WinMerge

          常用的Windows系統(tǒng)下的文件比較合并工具,最讓人喜歡的地方是可以方便地比較多個文檔內(nèi)容,適合經(jīng)常撰寫文稿或者程序員朋友使用。WinMerge會將兩個文件內(nèi)容不同的地方高亮顯示,比較快速地呈現(xiàn)給使用者,直接讓左方的文件內(nèi)容覆蓋至右方,反過來覆蓋也是完全沒問題的。

          四、Code Compare

          Code Compare是一款支持的語言比較多,C#、C++、CSS、HTML、Java、JavaScrip等代碼語言都可以再上面做比較,操作簡單。獨特的Visual Studio集成,可以在一個環(huán)境內(nèi)方便程序的開發(fā)設(shè)計。

          五、AptDiff

          AptDiff這款工具可以對文本和二進(jìn)制文件進(jìn)行比較和合并,對于網(wǎng)絡(luò)設(shè)計,軟件開發(fā)和其他專業(yè)領(lǐng)域都適用,快捷鍵盤讓這款工具使用起來非常便捷,同步進(jìn)行橫向和縱向卷動,支持Unicode格式和大于4GB的文件,快速生成HTML格式比較報告。

          那么,希望這些工具可以幫助開發(fā)設(shè)計的小伙伴們提升效率,你就有更多的時間去學(xué)習(xí)進(jìn)步,升職加薪啦!在之后的文章中緯小創(chuàng)會為大家繼續(xù)分享一些實用工具,如果你有更好的工具,也歡迎在評論區(qū)指教一下哦!

          screw,簡潔好用的數(shù)據(jù)庫表結(jié)構(gòu)文檔生成工具。

          特點,1、簡潔、輕量、設(shè)計良好,2、多數(shù)據(jù)庫支持,3、多種格式文檔,4、靈活擴(kuò)展。

          地址:https://gitee.com/leshalv/screw

          工程

          功能說明:

          將某個mysql數(shù)據(jù)庫中的表生成文檔,文檔格式可以是:html、word、markdown。

          pom.xml

          <!-- screw庫,簡潔好用的數(shù)據(jù)庫表結(jié)構(gòu)文檔生成器 -->
          <dependency>
              <groupId>cn.smallbun.screw</groupId>
              <artifactId>screw-core</artifactId>
              <version>1.0.5</version>
          </dependency>
          <!-- 數(shù)據(jù)庫連接 -->
          <dependency>
              <groupId>com.zaxxer</groupId>
              <artifactId>HikariCP</artifactId>
              <version>3.4.5</version>
          </dependency>
          <!-- Mysql Driver -->
          <dependency>
              <groupId>mysql</groupId>
              <artifactId>mysql-connector-java</artifactId>
              <version>8.0.20</version>
          </dependency>

          生成代碼:

          package com.what21.demo.screw;
          
          import cn.smallbun.screw.core.Configuration;
          import cn.smallbun.screw.core.engine.EngineConfig;
          import cn.smallbun.screw.core.engine.EngineFileType;
          import cn.smallbun.screw.core.engine.EngineTemplateType;
          import cn.smallbun.screw.core.execute.DocumentationExecute;
          import cn.smallbun.screw.core.process.ProcessConfig;
          import com.zaxxer.hikari.HikariConfig;
          import com.zaxxer.hikari.HikariDataSource;
          
          import javax.sql.DataSource;
          import java.util.Arrays;
          import java.util.Collections;
          
          public class ScrewMain {
          
              private static final String DB_URL = "jdbc:mysql://127.0.0.1:3306/xxl_job?serverTimezone=GMT";
              private static final String DB_USERNAME = "root";
              private static final String DB_PASSWORD = "root1234";
          
              private static final String FILE_OUTPUT_DIR = "D:/Download";
              // 可以設(shè)置 Word 或者 Markdown 格式
              private static final EngineFileType FILE_OUTPUT_TYPE = EngineFileType.MD;
              private static final String DOC_FILE_NAME = "數(shù)據(jù)庫文檔";
              private static final String DOC_VERSION = "1.0.0";
              private static final String DOC_DESCRIPTION = "文檔描述";
          
              public static void main(String[] args) {
                  // 創(chuàng)建 screw 的配置
                  Configuration config = Configuration.builder()
                          .version(DOC_VERSION)  // 版本
                          .description(DOC_DESCRIPTION) // 描述
                          .dataSource(buildDataSource()) // 數(shù)據(jù)源
                          .engineConfig(buildEngineConfig()) // 引擎配置
                          .produceConfig(buildProcessConfig()) // 處理配置
                          .build();
                  // 執(zhí)行 screw,生成數(shù)據(jù)庫文檔
                  new DocumentationExecute(config).execute();
              }
          
              /**
               * 創(chuàng)建數(shù)據(jù)源
               */
              private static DataSource buildDataSource() {
                  // 創(chuàng)建 HikariConfig 配置類
                  HikariConfig hikariConfig = new HikariConfig();
                  hikariConfig.setDriverClassName("com.mysql.cj.jdbc.Driver");
                  hikariConfig.setJdbcUrl(DB_URL);
                  hikariConfig.setUsername(DB_USERNAME);
                  hikariConfig.setPassword(DB_PASSWORD);
                  // 設(shè)置可以獲取 tables remarks 信息
                  hikariConfig.addDataSourceProperty("useInformationSchema", "true");
                  // 創(chuàng)建數(shù)據(jù)源
                  return new HikariDataSource(hikariConfig);
              }
          
              /**
               * 創(chuàng)建 screw 的引擎配置
               */
              private static EngineConfig buildEngineConfig() {
                  return EngineConfig.builder()
                          .fileOutputDir(FILE_OUTPUT_DIR) // 生成文件路徑
                          .openOutputDir(false) // 打開目錄
                          .fileType(FILE_OUTPUT_TYPE) // 文件類型
                          .produceType(EngineTemplateType.freemarker) // 文件類型
                          .fileName(DOC_FILE_NAME) // 自定義文件名稱
                          .build();
              }
          
              /**
               * 創(chuàng)建 screw 的處理配置,一般可忽略
               * 指定生成邏輯、當(dāng)存在指定表、指定表前綴、指定表后綴時,將生成指定表,其余表不生成、并跳過忽略表配置
               */
              private static ProcessConfig buildProcessConfig() {
                  return ProcessConfig.builder()
                          .designatedTableName(Collections.<String>emptyList())  // 根據(jù)名稱指定表生成
                          .designatedTablePrefix(Collections.<String>emptyList()) //根據(jù)表前綴生成
                          .designatedTableSuffix(Collections.<String>emptyList()) // 根據(jù)表后綴生成
                          .ignoreTableName(Arrays.asList("test_user", "test_group")) // 忽略表名
                          .ignoreTablePrefix(Collections.singletonList("test_")) // 忽略表前綴
                          .ignoreTableSuffix(Collections.singletonList("_test")) // 忽略表后綴
                          .build();
              }
          
          }

          生成的效果:


          主站蜘蛛池模板: 看电影来5566一区.二区| 日本免费电影一区| 亚洲欧美日韩一区二区三区在线 | 日韩视频在线观看一区二区| 免费高清在线影片一区| 日本免费一区二区三区最新vr| 精品免费国产一区二区三区| 国产精品亚洲不卡一区二区三区| 中文字幕一区二区三区乱码| 亚洲一区二区三区成人网站| 亚洲国产av一区二区三区| 一区二区三区四区免费视频| 国产福利无码一区在线| 亚洲成AV人片一区二区| 动漫精品专区一区二区三区不卡| 高清一区二区三区日本久| 一区二区三区内射美女毛片| 一区二区中文字幕在线观看| 国产午夜精品一区二区三区极品| 国精产品一区一区三区| 国产精品美女一区二区| 亚洲一区二区三区久久| 亚洲V无码一区二区三区四区观看| 国内精品一区二区三区在线观看 | 国产日本一区二区三区| 久久国产精品最新一区| 国产日韩AV免费无码一区二区| 午夜视频久久久久一区 | 在线观看国产一区| 亚洲国产精品一区二区九九| 精品一区二区三区免费观看| 一区二区三区福利视频| 亚洲国产精品乱码一区二区| 性色av一区二区三区夜夜嗨| 亚洲综合色自拍一区| 一区二区三区精品| 在线观看国产一区亚洲bd| 无码人妻久久一区二区三区蜜桃| 国产福利一区二区在线视频| 亚洲综合av永久无码精品一区二区| 中文字幕一区二区三区在线不卡|