首页 > 其他分享 >IDE-Visual Studio Code-Extension-离线安装PlantUML

IDE-Visual Studio Code-Extension-离线安装PlantUML

时间:2023-04-16 22:57:14浏览次数:59  
标签:code java Extension support 离线 Graphviz PlantUML Code usr

IDE-Visual Studio Code-Extension-离线安装PlantUML

https://www.hd2y.net/archives/plantuml-installation-and-use

PlantUML + Graphviz + Java

PlantUML Extension

  1. vscode marketplace 注意路径,我第一次下载的vs的插件。
    https://marketplace.visualstudio.com/vscode

  2. https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml

  3. 安装插件

  • 搜索vscode的位置:whereis code
yongchao@yongchao-virtual-machine:~/Desktop$ whereis code
code: /usr/bin/code /usr/share/code

两个目录code: /usr/bin/code /usr/share/code
左边为链接code可执行文件,右边的才是目录。

  • 然后
    cp jebbs.plantuml-2.17.5.vsix /usr/share/code/bin
    cd /usr/share/code/bin
    code --install-extension jebbs.plantuml-2.17.5.vsix
    或者vscode的插件管理右上角...有从visx安装
yongchao@yongchao-virtual-machine:/usr/share/code/bin$ code --install-extension jebbs.plantuml-2.17.5.vsix 
Installing extensions...
(node:32844) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `code --trace-deprecation ...` to show where the warning was created)
Extension 'jebbs.plantuml-2.17.5.vsix' was successfully installed.

Features

  • Preview Diagram, Press Alt + D to start PlantUML preview (option + D on MacOS).
    • Auto update.
    • Zoom & scroll support.
    • Multi-Page Diagram support.
    • Instant preview, if diagram's been exported.
    • From local or server.
    • Snap to Border
  • Export Diagrams
    • At cursor, in current file, in whole workspace, in workspace selected.
    • Concurrent export.
    • Generate URLs.
    • Multi-Page Diagram support.
    • From local or server.
    • Image map (cmapx) support.
  • Editing Supports
    • Format PlantUML code. (Deprecated)
    • All type syntax highlight.
    • All type snippets.
    • Basic auto completion & macro signature support
    • Symbol List support.
  • Others
    • Multi-root Workspace Support.
    • MarkDown integrating support. View Demo
    • Extracting source from images support.

Supported Formats

*.wsd, *.pu, *.puml, *.plantuml, *.iuml

Requirements for Local render

It's necessary to have following installed:

Java : Platform for PlantUML running.
Graphviz : PlantUML requires it to calculate positions in diagram.

Graphviz Extension

Graphviz (dot) language

support for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=joaompinto.vscode-graphviz
joaompinto.vscode-graphviz-0.0.6.vsix

Graphviz Interactive Preview

https://marketplace.visualstudio.com/items?itemName=tintinweb.graphviz-interactive-preview
tintinweb.graphviz-interactive-preview-0.3.5.vsix

Language Features

  • Graphviz/Dot Language Support / Syntax Highlighting and Snippets (thanks @joaompinto)
  • AutoCompletion
  • Rename Symbols
  • Find References of node IDs
  • Color selection via Color decoration
  • Hover information for settings
  • Shows syntax errors (only available when the preview of the document is active)

How to preview

Open a Graphviz/Dot file in the active editor and use either of the following methods to render the preview:

(a) open the command prompt (cmd+shift+p) and type > graphviz preview
(b) click the image button in the editor title
(c) from the editor window's context menu, select Preview Graphviz / Dot (beside)

导出

ctrl+shift+p打开首选项,输入:PlantUML:导出当前图表;选择导出格式png;导出即可。

java

jdk/jre:https://www.oracle.com/java/technologies/downloads/#java8

sudo mkdir /usr/local/java
sudo cp jdk-8u361-linux-x64.tar.gz /usr/local/java
cd /usr/local/java
sudo tar -zxvf jdk-8u361-linux-x64.tar.gz
sudo gedit ~/.bashrc

##java 8 jdk-8u361-linux-x64.tar.gz /usr/local/java
export JAVA_HOME=/usr/local/java/jdk1.8.0_361 
export JAVA_BIN=$JAVA_HOME/bin 
export JAVA_LIB=$JAVA_HOME/lib 
export CLASSPATH=.:$JAVA_LIB/tools.jar:$JAVA_LIB/dt.jar 
export PATH=$JAVA_BIN:$PATH

source ~/.bahsrc

java -version
java version "1.8.0_361"
Java(TM) SE Runtime Environment (build 1.8.0_361-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.361-b09, mixed mode)

Others

Q1

Dot Executable: /usr/bin/dot
File does not exist
Cannot find Graphviz. You should try

@startuml
testdot
@enduml

or

java -jar plantuml.jar -testdot

Q2

Error: File does not exist
Error: only sequence diagrams will be generated

Resolved Q1&Q2

安装包&源码

./configure
make
sudo make install

./configure --help

标签:code,java,Extension,support,离线,Graphviz,PlantUML,Code,usr
From: https://www.cnblogs.com/yongchao/p/17324347.html

相关文章

  • leetcode160-相交链表
    leetcode160方法一:哈希表思路:先创建一个unordered_set,存放ListNode*类型的变量先遍历其中一个链表,把所有节点的指针放在set中再遍历另一个链表,查找是否存在一个节点已经在set中,如果存在则说明这是它们的相交节点的指针,返回这个指针,如果不存在则说明不存在相交节点,......
  • Codeforces Round 764 (Div. 3) -- E. Masha-forgetful
    **题目大意:取去模板串中的子串可以组成一个给定的目标串,每个子串可以用无数次,输出组成的所需的串的信息题目中的取得子串必须“>=2”很好的提示了我们,想到一个式子2*x+3*y可以等于任何数,所以从之前的串都取长度为2,为3。在进行匹配。**structnode{ intl,......
  • LeetCode-Top100: 有效的括号 (python)
     给定一个只包括 '(',')','{','}','[',']' 的字符串 s ,判断字符串是否有效。有效字符串需满足:左括号必须用相同类型的右括号闭合。左括号必须以正确的顺序闭合。每个右括号都有一个对应的相同类型的左括号。 示例1:输入:s="()"输出:true示例 2:输入:s="()[]{}"输......
  • LeetCode-Top100:两数之和(python)
     给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 target 的那 两个 整数,并返回它们的数组下标。你可以假设每种输入只会对应一个答案。但是,数组中同一个元素在答案里不能重复出现。你可以按任意顺序返回答案。 示例1:输入:nums=......
  • leetcode_打卡5
    leetcode_打卡5题目:345.反转字符串中的元音字母思路:双指针classSolution{publicStringreverseVowels(Strings){intn=s.length();char[]arr=s.toCharArray();inti=0;intj=n-1;while(i<j){while(i<n&&!yua......
  • C++20 Advent of Code 可见树 Day 8: Treetop Tree House
    C++20AdventofCode可见树Day8:TreetopTreeHouseDay8-AdventofCode2022#include<iostream>#include<vector>#include<fstream>#include<string>#include<ranges>#include<numeric>#include<algorithm>#in......
  • 如何在VS Code中安装和使用CodeGPT
    人工智能改变世界的众多方式之一是通过智能代码完成和将自然语言转换为代码。在这一领域,OpenAI凭借其GPT-3系列Codex模型和最新的GPT-4模型一直处于领先地位。因此,如果你想在VisualStudioCode本身中使用ChatGPT,请按照本教程了解CodeGPT。它是一个位于VSCode中的AI助手,您可以与......
  • Topcoder 10880 - Rabbit Problemming
    \[兔子,兔子,兔子\]首先,我们考虑一只兔子可以达到的最大值\(mx_i\)和最小值\(mn_i\),这个可以很方便的求出来。并且每只兔子的取值是独立的。然后,如果一个组合能被选中,那么在这个组合内部所有的兔子都取\(mx_i\),其他的兔子都取\(mn_i\)的时候一定也能被选中。我们就钦定所有......
  • 【C#】Whisper 离线语音识别(微软晓晓语音合成的音频)(带时间戳、srt字幕)...
    https://blog.csdn.net/cxyhjl/article/details/129905927 用微软语音合成功能生成xiaoxiao的语音。用Whisper离线识别合成的语音输出srt字幕。一、语音合成参考这个网址:https://www.bilibili.com/read/cv19064633 合成的音频:晓晓朗读-温柔二、Whisper语音识别下载模......
  • AtCoder Beginner Contest 295
    ThreeDaysAgo我们定义一个只由数字构成的字符串中的字符能够被重排成相同的两份,我们称这个字符串是个好字符串,比如12341234现在给定一个字符串\(S\),找出所有的\([l,r]\),使得在这段区间中的子段是个好字符串题解:思维+组合计数首先我们根据题意得到:一个好字符串中所有相......