[英]Django - create code blocks in html templates
我想創建一個 web 頁面,它將顯示我在代碼塊內的表格中的數據,就像它在這里一樣,即使有一個副本 function。我已經可以在頁面上顯示數據,我只是想擁有它格式化在一個漂亮的盒子里,甚至可能有語法高亮,我看着 Pygments 但我無法讓它工作。 下面是我想在我的 Django 應用程序中重新創建 ...
[英]Django - create code blocks in html templates
我想創建一個 web 頁面,它將顯示我在代碼塊內的表格中的數據,就像它在這里一樣,即使有一個副本 function。我已經可以在頁面上顯示數據,我只是想擁有它格式化在一個漂亮的盒子里,甚至可能有語法高亮,我看着 Pygments 但我無法讓它工作。 下面是我想在我的 Django 應用程序中重新創建 ...
[英]Disable stripping of trailing newlines from code blocks
我正在創建一個包含一些代碼塊的 Asciidoctor 文檔。 我使用pygments作為語法熒光筆。 在 output 中,刪除了代碼塊中的尾隨空行。 通常這很好,但在某些特定情況下,我想在 output 中的代碼之后包含一個空行。 pygments應該可以做到這一點,因為文檔指出: 目前,所有 ...
[英]No valid lexer class found error when testing custom Pygments lexer
我將一個理想情況下應該用於偽代碼的詞法分析器放在一起,但是當我使用python3 -m pygments -x -l./psuedo.py:PseudoLexer test.pseudo測試它時,我不斷收到以下錯誤:“找不到有效的 PseudoLexer 類在./psuedo.py”。 我查看了我的 ...
[英]Any Pygments lexer for the Mustache templating language?
賞金將在 7 天后到期。 此問題的答案有資格獲得+50聲望賞金。 Nicole Naumann正在尋找一個規范的答案。 我想在我的論文中列出 Mustache 模板的源代碼,並且我正在使用鑄造的 package 來突出顯示 LaTeX 源代碼中的代碼。 鑄造的 package 僅使用 Pygme ...
[英]"pygmentize: command not found" Even though I already installed pygments on my system
我嘗試使用apt-get install python3-pygments和pip install Pygments在Debian 9上安裝pygments ,但沒有任何方法可以在命令行上運行。 我懷疑我的PATH不包含安裝路徑。 我將/usr/lib/python3/dist-packages/ ...
[英]pygments highlight print in jupyter
我想將帶有 sql 的字符串打印到我的 jupyter 筆記本中,如下所示 這是用 pygments 手動完成的, 請參見這是我到目前為止嘗試過的 在 output 中,關鍵字既不是綠色也不是粗體。 (我正在使用 Jupyterlab。) ...
[英]How to highlight whole syntax(including every modules's Keywords,class,etc.) of python in text widget in python tkinter
我正在創建代碼編輯器,我想正確突出顯示每個代碼。 我創建了一個代碼來突出顯示代碼,並且創建了一個不同的 function 來突出顯示字符串和注釋,但是當我鍵入任何已經包含要突出顯示的顏色的代碼時,不會在“”內顯示字符串顏色,但我只想顯示該代碼它在“”之外是自己的顏色,而不是在內部,例如,如果我從它 ...
[英]Showing the line numbers in <pre> in Django project using Pygments
我在我的 Django 項目中使用Pygments package。 當我嘗試在我的模板中呈現代碼片段時,它會呈現整個數據,如下所示: 模板:... {% pygmentify %} <pre class="{{snippet.lang}}">{{snippet.body}}</ ...
[英]Highlighting the inner code blocks in Django Template Engine with django-pygmentify
我正在使用django-pygmentify package 來突出顯示我的 Django 模板中的代碼塊。 問題是這個 package 只支持代碼塊作為輸入。 我有一個保留 markdown 數據的 model 字段。 此 markdown 內容可能包含代碼塊。 (使用 ``` 符號) 現在,我 ...
[英]How to activate Pygments in Pelican?
我必須做些什么才能讓它像官方文檔中的這個例子一樣簡單? 我應該向 pelicanconf.py 添加什么? 這是我的requirements.txt: 我正在使用虛擬環境,也許這有幫助。 ...
[英]Pygments and ImageFormatter: set output to 80 columns
ImageFormatter始終創建一個 PNG 輸出,其寬度取決於ImageFormatter 。 例如,此 PNG 寬 192 像素: 這是 384: Pygments是否有模擬 80 列輸出的設置,因此所有圖像都將具有相同的寬度? 這是我用來生成示例的代碼: ...
[英]How to analyze source code by pygments(using pygount) and get a SUM
使用pygount我試圖獲得以下內容的總和:代碼、注釋和空。 我沒有任何錯誤,但我想我弄亂了我的相對路徑。 首先檢查下面的樹以進行可視化 ROOT_DIR const def 位於 util 文件夾的__init__內。 我不確定我的相對路徑是否應該有 1x 或 2x .parent才能到達“T ...
[英]is there a way to bind key press to root without disturbing default binds in tkinter
I am trying to add syntax highlighting to the text widget in tkinter i am using the code from another stack overflow question Pygments syntax highlig ...
[英]All I want to do is display an asci string in a Panel widget and retain its formatting/color
我要做的就是在 Panel 小部件中顯示一個 asci 字符串並保留其格式/顏色。 我想要的是: 我有的: ...
[英]How to customize Pygments css classes output
如何更改 Pygments output 的類? 例如,這是 pygments 默認的 output: 我希望跨度元素的 output 使用我提供的類。 我怎么做? ...
[英]How to include pygments in vimwiki html /smarty file?
我正在使用 vimwiki,它允許我添加 smarty/html 模板文件以及 css。 我知道如何使用 pygments 生成 css 文件,但問題是如何讓 css 包含基於<pre>標簽輸入的所有類? 例如,如果 pre 標簽是這樣的:<pre class='pygments ...
[英]ImportError: No module named pygments.styles when attempting to run Pythontex
當我嘗試通過命令行運行 pythontex ( (base) Zachs-MacBook-Pro:mat_300 zachmaurus$ pythontex pythontex.tex)時,會發生以下情況: 我該如何解決這個問題? 我已經使用pip install下載了 pygments,但是無論出 ...
[英]Set the html fontsize in `pygmentize`, the command line tool of `pygments`
我正在嘗試使用pygments通過命令行工具pygmentize使用以下命令將 python 文件轉換為 html 文件: 不幸的是,默認字體太小,我不知道如何增加它。 使用-O fontsize=16不會引發錯誤,但也沒有任何影響。 此外,我通過將html *{font-size: 1.05 ...
[英]Fix some very minor issues and rebuild sphinx but got the error “wrong color format”
我在“源”文件夾中進行了一些最小的更新,並使用make html命令重建了 HTML。 一切正常,我將文件夾同步到 GitHub。 但是,當我在 Read the Docs 網站上重建文檔時,在cat source/conf.py之后我得到了這樣的錯誤: 我只是在我的文檔中添加了一些文本並修復了 ...
[英]cx_Freeze: Python error main script. Module not found error: no module named pygments.lexers.python
我正在嘗試使用cx_Freeze從.py文件創建文件.exe 。 我已經成功構建了安裝文件,但是當我運行.exe文件時,它返回了這個錯誤: -我嘗試再次安裝 Python -我試圖更新 pygments 但它說要求已經滿足有什么建議么? 幫助這個可憐的新生程序員 ...