小编tim*_*our的帖子

如何在github&gitlab问题中将markdown"``code blocks```中的长行换行?

例如:

```
some very long line; some very long line; some very long line; some very long line; some very long line; some very long line; some very long line; some very long line; some very long line; some very long line; 
```
Run Code Online (Sandbox Code Playgroud)

将强制用户滚动github/gitlab问题.有没有办法软线包裹code block

我已经阅读了相关的问题,但它们似乎有所不同(例如jekyll等).

编辑:手动编辑代码限制为80列不是一个可行的选项(例如,从编译器输出/日志等粘贴;这是很多工作,不应该是必要的)

markdown github word-wrap gitlab

27
推荐指数
7
解决办法
1万
查看次数

如何更改 github README.md 的渲染宽度?

当浏览到https://github.com/timotheecour/D_vs_nimhttps://github.com/timotheecour/D_vs_nim/blob/master/README.md时,我希望显示的降价以自定义(更大)宽度显示。那可能吗?如果可能的话,宽度将取决于浏览器窗口的大小,例如width=max(browser_width, fixed_width)

编辑:好奇https://github.com/github/markup中的 PR 是否有助于实现这一目标。

markdown github width readme

8
推荐指数
1
解决办法
5353
查看次数

如何在 github 操作中为 push: 和 pull_request: 考虑共同的“path:”?

I\xe2\x80\x99d 喜欢在其中考虑公共路径:

\n\n
on:\n  push:\n    # Run only on changes on these files\n    paths:\n      - \'lib/**.nim\'\n      - \'doc/**.rst\'\n      - \'doc/nimdoc.css\'\n      - \'.github/workflows/ci_docs.yml\'\n\n  pull_request:\n    # Run only on changes on these files\n    paths:\n      - \'lib/**.nim\'\n      - \'doc/**.rst\'\n      - \'.github/workflows/ci_docs.yml\'\n
Run Code Online (Sandbox Code Playgroud)\n\n

github 上的文档提到了[push, pull_request],但如果我们有路径节点,它就不会\xe2\x80\x99 工作。避免代码重复的语法是什么?

\n\n

(提前为与https://github.community/t/how-to-factor-paths-in-common-for-push-and-pull-request/115967的交叉发帖道歉,如果我得到任何答案,我\'将在另一端更新)

\n

path pull-request github-actions

8
推荐指数
1
解决办法
5024
查看次数

如何将警告视为Makefile中的错误?

  1. 是否可以将警告视为Makfile中的错误(因此在Makefile继续之前退出)

  2. 此外,是否可以过滤掉哪个警告产生错误?

我的用例:我想--warn-undefined-variables与此结合使用,以便在未定义变量时Makefile将退出,这是一个非常常见的错误来源.显然我不想手动检查每个变量,因为这很容易出错/繁琐.我在这方面找不到任何东西,但这是一个非常重要/基本的功能.

注意:我不是在寻找-Werror哪个是不适用于我的用例的gcc特定命令.

warnings makefile undefined build-error

7
推荐指数
2
解决办法
3879
查看次数

如何在 ncurses 中的 mvwprintw 中使用 ANSI 转义码?

有没有办法在里面使用 ANSI 转义码mvwprintw

mvwprintw(window, 0, 0,"%c[%dmCOLORED_TEXT!\n", 0x1B, 32);//doesn't work
Run Code Online (Sandbox Code Playgroud)

虽然:

printf("%c[%dmCOLORED_TEXT\n", 0x1B, 32); //works
Run Code Online (Sandbox Code Playgroud)

这适用于使用wattron/wattroff不方便的情况;例如,当从输出此类转义码的进程的 stdout 重定向输出时。

ncurses ansi-escape

7
推荐指数
1
解决办法
2851
查看次数

如何在tmux中滚动到滚动缓冲区的开头/结尾?

^ b +页面向上/向下滚动向上/向下滚动缓冲区的一页,但我们如何滚动到开头?

喜欢结束(除了按^ C杀死滚动)

scroll tmux

7
推荐指数
1
解决办法
4519
查看次数

如何用git --word-diff显示空白差异?

为了说明问题:参见diff

本段中唯一的差异(从A macro that needs空格差异开始(在某些地方插入/删除换行符);

  • 在运行时git diff它显示红色之前的段落和红色之后的段落,这使得很难发现差异
  • 在运行时git diff --word-diff,它显示灰色后的段落,并且不显示空白更改
  • git diff --word-diff-regex=.它运行时显示空白变化(太棒了!)但是[编辑]它通过字符差异来做字符,这通常是不可读的,因为它混合来自不同单词的字母以最小化差异,例如: git show --word-diff-regex=. 4a720394bba39ce1e67d518b909cbb1c25f63d09 [- * patch compile-]r [-so `isM-]a[-inModule`-] [-is true when -d:isMainModuleIsAlwaysTr-]{+m+}u[-e-] [- T-]{+c+}h[-at'll give speedup-] be[-nefi-]t[-, and we don'-]t[- hav-]e{+r+} [-to p-]{+w+}a[-tch stdlib files-]{+y+}. ]#

我想要的是在运行时显示空白差异的选项--word-diff(或--word-diff-regex),例如通过{+ +}[- -]; 注意:因为--word-diff=color很好地展示这些,例如也通过{+ +},[- -]否则这些将消失.

注意:我在gitconfig中使用颜色.

注意:没有用,因为输出中没有显示空白差异git diff --word-diff=porcelain

git diff whitespace word-diff

7
推荐指数
1
解决办法
435
查看次数

如何在C++模块中使用标准库?(例如:`import std.io`)

我如何在Clang中使用C++模块中给出的基本示例适合我,但不导入标准库(例如via import std.stdio;); 在浏览了http://clang.llvm.org/docs/Modules.html之后,目前尚不清楚如何在C++模块中使用标准库,例如:

// foo.cppm:
export module foo;
// works: #include <stdio.h>
// none of these work:
import std.stdio;
import std.io;
import std;

export void test_foo(){
  printf("hello world\n");
}
Run Code Online (Sandbox Code Playgroud)

这给出了一个错误: clang++ -std=c++17 -fmodules-ts --precompile foo.cppm -o foo.pcm foo.cppm:4:8: fatal error: module 'std.stdio' not found

注意: clang++ --version Apple LLVM version 9.1.0 (clang-902.0.39.1) Target: x86_64-apple-darwin17.4.0 我在OSX上.我也试过brew install llvm的clang也没用.

制作这样的作品最简单的方法是什么?

c++ std clang standard-library c++-modules

6
推荐指数
1
解决办法
883
查看次数

在 SWIG 包装器中导出注释

假设我有一个 C++ 头文件 fun.hpp:

//existing description of what fun1 does
void fun1(int x);
//existing description of what fun2 does
void fun2(int x);
Run Code Online (Sandbox Code Playgroud)

我想生成一个 SWIG 包装器,以便注释将以目标语言显示:

  1. 在单独的 HTML 文档中
  2. 嵌入到目标生成的包装器代码中

有任何想法吗?

c++ swig comments

5
推荐指数
0
解决办法
533
查看次数

在OS X上安装金链接器

我正试图在OS X上获得金链接器.我尝试了两个brew install binutils(有效,但没有金链接器)并从git head安装(失败).

macos linker homebrew

5
推荐指数
1
解决办法
1668
查看次数

file "is damaged and can't be opened" when opening twice a mounted file

I have a mounted directory to access some images. When opening an image for the first time with open /mounted_dir/foo.jpg it opens the image in preview. When repeating the same command it gives the error: /mounted_dir/foo.jpg is damaged and can't be opened. You should move it to the Trash.

I have seen this error message on the web but only for apps, not image files. Furthermore, the file in question doesn't appear damaged, eg:

cp /mounted_dir/foo.jpg /tmp/foo.jpg
diff /mounted_dir/foo.jpg /tmp/foo.jpg …
Run Code Online (Sandbox Code Playgroud)

macos file osx-gatekeeper

4
推荐指数
1
解决办法
3265
查看次数