[Core] Add a language to every code block (#39212)
Co-authored-by: Peter Bengtsson <mail@peterbe.com>
This commit is contained in:
@@ -61,7 +61,7 @@ You can check the email address used for a commit by adding `.patch` to the end
|
||||
|
||||
[https://github.com/octocat/octocat.github.io/commit/67c0afc1da354d8571f51b6f0af8f2794117fd10.patch](https://github.com/octocat/octocat.github.io/commit/67c0afc1da354d8571f51b6f0af8f2794117fd10.patch)
|
||||
|
||||
```
|
||||
```text
|
||||
From 67c0afc1da354d8571f51b6f0af8f2794117fd10 Mon Sep 17 00:00:00 2001
|
||||
From: The Octocat <octocat@nowhere.com>
|
||||
Date: Sun, 27 Apr 2014 15:36:39 +0530
|
||||
|
||||
@@ -70,7 +70,7 @@ If you are a site administrator for {% data variables.location.product_location
|
||||
> Generating public/private ALGORITHM key pair.
|
||||
```
|
||||
|
||||
1. When you're prompted to "Enter a file in which to save the key", you can press **Enter** to accept the default file location. Please note that if you created SSH keys previously, ssh-keygen may ask you to rewrite another key, in which case we recommend creating a custom-named SSH key. To do so, type the default file location and replace id_ssh_keyname with your custom key name.
|
||||
When you're prompted to "Enter a file in which to save the key", you can press **Enter** to accept the default file location. Please note that if you created SSH keys previously, ssh-keygen may ask you to rewrite another key, in which case we recommend creating a custom-named SSH key. To do so, type the default file location and replace id_ssh_keyname with your custom key name.
|
||||
|
||||
{% mac %}
|
||||
|
||||
@@ -128,7 +128,7 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav
|
||||
|
||||
- Open your `~/.ssh/config` file, then modify the file to contain the following lines. If your SSH key file has a different name or path than the example code, modify the filename or path to match your current setup.
|
||||
|
||||
```
|
||||
```text
|
||||
Host {% ifversion ghes or ghae %}HOSTNAME{% else %}github.com{% endif %}
|
||||
AddKeysToAgent yes
|
||||
UseKeychain yes
|
||||
@@ -143,7 +143,7 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav
|
||||
|
||||
- If you see a `Bad configuration option: usekeychain` error, add an additional line to the configuration's' `Host *.{% ifversion ghes or ghae %}HOSTNAME{% else %}github.com{% endif %}` section.
|
||||
|
||||
```
|
||||
```text
|
||||
Host {% ifversion ghes or ghae %}HOSTNAME{% else %}github.com{% endif %}
|
||||
IgnoreUnknown UseKeychain
|
||||
```
|
||||
|
||||
@@ -80,7 +80,7 @@ To illustrate how `git filter-repo` works, we'll show you how to remove your fil
|
||||
|
||||
1. Install the latest release of the [git filter-repo](https://github.com/newren/git-filter-repo) tool. You can install `git-filter-repo` manually or by using a package manager. For example, to install the tool with HomeBrew, use the `brew install` command.
|
||||
|
||||
```
|
||||
```shell
|
||||
brew install git-filter-repo
|
||||
```
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ If that worked, great! If not, you may need to [follow our troubleshooting guide
|
||||
|
||||
Now, to clone the repository, you can run the following command:
|
||||
|
||||
```
|
||||
```shell
|
||||
git clone ssh://git@ssh.{% data variables.command_line.codeblock %}:443/YOUR-USERNAME/YOUR-REPOSITORY.git
|
||||
```
|
||||
|
||||
@@ -46,7 +46,7 @@ If you are able to SSH into `git@ssh.{% data variables.command_line.backticks %}
|
||||
|
||||
To set this in your SSH configuration file, edit the file at `~/.ssh/config`, and add this section:
|
||||
|
||||
```
|
||||
```text
|
||||
Host {% data variables.command_line.codeblock %}
|
||||
Hostname ssh.{% data variables.command_line.codeblock %}
|
||||
Port 443
|
||||
|
||||
@@ -37,7 +37,7 @@ Under "Calculate Additional Advanced Committers", you can calculate how many mor
|
||||
1. In the left sidebar, click **Advanced Security Committers**.
|
||||
1. Under "Organizations and Repositories", enter or paste a list of organizations and repositories, with one organization or repository per line. For example:
|
||||
|
||||
```
|
||||
```text
|
||||
example-org
|
||||
octo-org/octo-repo
|
||||
```
|
||||
|
||||
@@ -77,7 +77,7 @@ A `.gitattributes` file looks like a table with two columns:
|
||||
|
||||
Here's an example `.gitattributes` file. You can use it as a template for your repositories:
|
||||
|
||||
```
|
||||
```text
|
||||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text=auto
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ There are six commands available while rebasing:
|
||||
|
||||
No matter which command you use, Git will launch [your default text editor](/get-started/getting-started-with-git/associating-text-editors-with-git) and open a file that details the commits in the range you've chosen. That file looks something like this:
|
||||
|
||||
```
|
||||
```text
|
||||
pick 1fc6c95 Patch A
|
||||
pick 6b2481b Patch B
|
||||
pick dd1475d something I want to split
|
||||
|
||||
@@ -20,7 +20,7 @@ In this example, we will cover all of the `git rebase` commands available, excep
|
||||
|
||||
We'll start our rebase by entering `git rebase --interactive HEAD~7` on the terminal. Our favorite text editor will display the following lines:
|
||||
|
||||
```
|
||||
```text
|
||||
pick 1fc6c95 Patch A
|
||||
pick 6b2481b Patch B
|
||||
pick dd1475d something I want to split
|
||||
@@ -42,7 +42,7 @@ Phew! This sounds like a lot of work, but by taking it one step at a time, we ca
|
||||
|
||||
To start, we'll need to modify the commands in the file to look like this:
|
||||
|
||||
```
|
||||
```text
|
||||
pick 1fc6c95 Patch A
|
||||
squash fa39187 something to add to patch A
|
||||
pick 7b36971 something to move before patch B
|
||||
@@ -58,7 +58,7 @@ Now, save and close the editor; this will start the interactive rebase.
|
||||
|
||||
Git skips the first rebase command, `pick 1fc6c95`, since it doesn't need to do anything. It goes to the next command, `squash fa39187`. Since this operation requires your input, Git opens your text editor once again. The file it opens up looks something like this:
|
||||
|
||||
```
|
||||
```text
|
||||
# This is a combination of two commits.
|
||||
# The first commit's message is:
|
||||
|
||||
@@ -82,7 +82,7 @@ This file is Git's way of saying, "Hey, here's what I'm about to do with this `s
|
||||
|
||||
When the editor is closed, the rebase continues:
|
||||
|
||||
```
|
||||
```text
|
||||
pick 1fc6c95 Patch A
|
||||
squash fa39187 something to add to patch A
|
||||
pick 7b36971 something to move before patch B
|
||||
@@ -110,7 +110,7 @@ At this point, you can edit any of the files in your project to make any additio
|
||||
|
||||
Git then gets to the `reword 4ca2acc` command. It opens up your text editor one more time, and presents the following information:
|
||||
|
||||
```
|
||||
```text
|
||||
i cant' typ goods
|
||||
|
||||
# Please enter the commit message for your changes. Lines starting
|
||||
|
||||
@@ -317,7 +317,7 @@ You can create a new paragraph by leaving a blank line between lines of text.
|
||||
|
||||
You can add footnotes to your content by using this bracket syntax:
|
||||
|
||||
```
|
||||
```text
|
||||
Here is a simple footnote[^1].
|
||||
|
||||
A footnote can also have multiple lines[^2].
|
||||
|
||||
@@ -22,7 +22,7 @@ There are two options for delimiting a math expression inline with your text. Yo
|
||||
To include a math expression inline within your text, delimit the expression with dollar symbols `$`.
|
||||
{% endif %}
|
||||
|
||||
```
|
||||
```text
|
||||
This sentence uses `$` delimiters to show math inline: $\sqrt{3x-1}+(1+x)^2$
|
||||
```
|
||||
|
||||
@@ -30,9 +30,9 @@ This sentence uses `$` delimiters to show math inline: $\sqrt{3x-1}+(1+x)^2$
|
||||
|
||||
{% ifversion math-backtick-syntax %}
|
||||
|
||||
````
|
||||
```text
|
||||
This sentence uses $\` and \`$ delimiters to show math inline: $`\sqrt{3x-1}+(1+x)^2`$
|
||||
````
|
||||
```
|
||||
|
||||

|
||||
{% endif %}
|
||||
@@ -41,7 +41,7 @@ This sentence uses $\` and \`$ delimiters to show math inline: $`\sqrt{3x-1}+(1
|
||||
|
||||
To add a math expression as a block, start a new line and delimit the expression with two dollar symbols `$$`.
|
||||
|
||||
```
|
||||
```text
|
||||
**The Cauchy-Schwarz Inequality**
|
||||
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
|
||||
```
|
||||
@@ -52,7 +52,7 @@ $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \
|
||||
|
||||
Alternatively, you can use the <code>\`\`\`math</code> code block syntax to display a math expression as a block. With this syntax, you don't need to use `$$` delimiters. The following will render the same as above:
|
||||
|
||||
````
|
||||
````text
|
||||
**The Cauchy-Schwarz Inequality**
|
||||
|
||||
```math
|
||||
@@ -68,7 +68,7 @@ To display a dollar sign as a character in the same line as a mathematical expre
|
||||
|
||||
- Within a math expression, add a `\` symbol before the explicit `$`.
|
||||
|
||||
```
|
||||
```text
|
||||
This expression uses `\$` to display a dollar sign: $\sqrt{\$4}$
|
||||
```
|
||||
|
||||
@@ -76,7 +76,7 @@ To display a dollar sign as a character in the same line as a mathematical expre
|
||||
|
||||
- Outside a math expression, but on the same line, use span tags around the explicit `$`.
|
||||
|
||||
```
|
||||
```text
|
||||
To split <span>$</span>100 in half, we calculate $100/2$
|
||||
```
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ When you create a new tasklist, the default title is "Tasks." You can modify the
|
||||
|
||||
When you copy your tasklist using the "Copy Markdown" option, {% data variables.product.product_name %} copies Markdown to your clipboard and includes the issue title so you can paste the tasklist outside of GitHub without losing context. See below for an example of a copied Markdown tasklist:
|
||||
|
||||
```
|
||||
```markdown
|
||||
- [x] [Design new landing page](https://github.com/octocat/octoproject/issues/4)
|
||||
- [ ] [Translate content into supported languages](https://github.com/octocat/octoproject/issues/11)
|
||||
```
|
||||
|
||||
@@ -21,7 +21,7 @@ The Tracked by field can be used to group items, creating a view that clearly sh
|
||||
|
||||
You can also filter by the Tracked by field to display only items that are tracked by specific issues. Either start typing "tracked-by" and select an issue from the list or, if you know the repository and issue number, you can type the filter below in full.
|
||||
|
||||
```
|
||||
```text
|
||||
tracked-by:"<OWNER>/<REPO>#<ISSUE NUMBER>"
|
||||
```
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ You can send the URL that issues generates to any user, and they'll be able to s
|
||||
|
||||
For example, if you filter on issues assigned to Hubot, and sort on the oldest open issues, your URL would update to something like the following:
|
||||
|
||||
```
|
||||
```text
|
||||
/issues?q=state:open+type:issue+assignee:hubot+sort:created-asc
|
||||
```
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ To follow these steps, you must use a macOS or Linux system and have the followi
|
||||
|
||||
1. Update your `committers.txt` file, mapping the committer name used in the Mercurial repository to the name you want to use in your Git repository, with the following format:
|
||||
|
||||
```
|
||||
```text
|
||||
“The Octocat <octocato@gmail.com>”=”Octocat <octocat@github.com>”
|
||||
```
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ To follow these steps, you must use a macOS or Linux system and have the followi
|
||||
|
||||
1. Update your `authors.txt` file, mapping the author name used in the Subversion repository to the name you want to use in your Git repository, with the following format:
|
||||
|
||||
```
|
||||
```text
|
||||
octocat = The Octocat <octocat@github.com>
|
||||
```
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ If you are verifying a domain you own, which is currently in use by another user
|
||||
{% data reusables.pages.settings-verify-domain-setup %}
|
||||
1. Wait for your DNS configuration to change, this may be immediate or take up to 24 hours. You can confirm the change to your DNS configuration by running the `dig` command on the command line. In the command below, replace `USERNAME` with your username and `example.com` with the domain you're verifying. If your DNS configuration has updated, you should see your new TXT record in the output.
|
||||
|
||||
```
|
||||
```text
|
||||
dig _github-pages-challenge-USERNAME.example.com +nostats +nocomments +nocmd TXT
|
||||
```
|
||||
|
||||
@@ -49,7 +49,7 @@ Organization owners can verify custom domains for their organization.
|
||||
{% data reusables.pages.settings-verify-domain-setup %}
|
||||
1. Wait for your DNS configuration to change. This may be immediate or take up to 24 hours. You can confirm the change to your DNS configuration by running the `dig` command on the command line. In the command below, replace `ORGANIZATION` with the name of your organization and `example.com` with the domain you're verifying. If your DNS configuration has updated, you should see your new TXT record in the output.
|
||||
|
||||
```
|
||||
```text
|
||||
dig _github-pages-challenge-ORGANIZATION.example.com +nostats +nocomments +nocmd TXT
|
||||
```
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ For example, if you and another person both edited the file _styleguide.md_ on t
|
||||
1. Open your favorite text editor, such as [{% data variables.product.prodname_vscode %}](https://code.visualstudio.com/), and navigate to the file that has merge conflicts.
|
||||
1. To see the beginning of the merge conflict in your file, search the file for the conflict marker `<<<<<<<`. When you open the file in your text editor, you'll see the changes from the HEAD or base branch after the line `<<<<<<< HEAD`. Next, you'll see `=======`, which divides your changes from the changes in the other branch, followed by `>>>>>>> BRANCH-NAME`. In this example, one person wrote "open an issue" in the base or HEAD branch and another person wrote "ask your question in IRC" in the compare branch or `branch-a`.
|
||||
|
||||
```
|
||||
```text
|
||||
If you have questions, please
|
||||
<<<<<<< HEAD
|
||||
open an issue
|
||||
|
||||
@@ -92,6 +92,6 @@ It is recommended that you do not use path filtering (as shown in the previous e
|
||||
|
||||
It's also possible for a protected branch to require a status check from a specific {% data variables.product.prodname_github_app %}. If you see a message similar to the following, then you should verify that the check listed in the merge box was set by the expected app.
|
||||
|
||||
```
|
||||
```text
|
||||
Required status check "build" was not set by the expected {% data variables.product.prodname_github_app %}.
|
||||
```
|
||||
|
||||
@@ -50,6 +50,6 @@ git remote set-head origin -a
|
||||
|
||||
Optionally, run the following command to remove tracking references to the old branch name.
|
||||
|
||||
```
|
||||
```shell
|
||||
git remote prune origin
|
||||
```
|
||||
|
||||
@@ -17,7 +17,7 @@ You can add a `CITATION.cff` file to the root of a repository to let others know
|
||||
|
||||
Example `CITATION.cff` file:
|
||||
|
||||
```
|
||||
```text
|
||||
cff-version: 1.2.0
|
||||
message: "If you use this software, please cite it as below."
|
||||
authors:
|
||||
@@ -34,11 +34,11 @@ date-released: 2017-12-18
|
||||
url: "https://github.com/github-linguist/linguist"
|
||||
```
|
||||
|
||||
The GitHub citation prompt on your repository will show the example `CITATION.cff` content in these formats:
|
||||
The {% data variables.product.company_short %} citation prompt on your repository will show the example `CITATION.cff` content in these formats:
|
||||
|
||||
**APA**
|
||||
|
||||
```
|
||||
```text
|
||||
Lisa, M., & Bot, H. (2017). My Research Software (Version 2.0.4) [Computer software]. https://doi.org/10.5281/zenodo.1234
|
||||
```
|
||||
|
||||
@@ -46,7 +46,7 @@ Lisa, M., & Bot, H. (2017). My Research Software (Version 2.0.4) [Computer softw
|
||||
|
||||
{% raw %}
|
||||
|
||||
```
|
||||
```text
|
||||
@software{Lisa_My_Research_Software_2017,
|
||||
author = {Lisa, Mona and Bot, Hew},
|
||||
doi = {10.5281/zenodo.1234},
|
||||
@@ -96,7 +96,7 @@ If you would prefer the {% data variables.product.prodname_dotcom %} citation in
|
||||
|
||||
Extended CITATION.cff file describing the software, but linking to a research article as the preferred citation:
|
||||
|
||||
```
|
||||
```text
|
||||
cff-version: 1.2.0
|
||||
message: "If you use this software, please cite it as below."
|
||||
authors:
|
||||
@@ -131,11 +131,11 @@ preferred-citation:
|
||||
year: 2021
|
||||
```
|
||||
|
||||
The example `CITATION.cff` file above will produce the following outputs in the GitHub citation prompt:
|
||||
The example `CITATION.cff` file above will produce the following outputs in the {% data variables.product.company_short %} citation prompt:
|
||||
|
||||
**APA**
|
||||
|
||||
```
|
||||
```text
|
||||
Lisa, M., & Bot, H. (2021). My awesome research software. Journal Title, 1(1), 1. https://doi.org/10.0000/00000
|
||||
```
|
||||
|
||||
@@ -143,7 +143,7 @@ Lisa, M., & Bot, H. (2021). My awesome research software. Journal Title, 1(1), 1
|
||||
|
||||
{% raw %}
|
||||
|
||||
```
|
||||
```text
|
||||
@article{Lisa_My_awesome_research_2021,
|
||||
author = {Lisa, Mona and Bot, Hew},
|
||||
doi = {10.0000/00000},
|
||||
@@ -165,11 +165,11 @@ If your repository contains a dataset, you can set `type: dataset` at the top le
|
||||
|
||||
## Other citation files
|
||||
|
||||
The GitHub citation feature will also detect a small number of additional files that are often used by communities and projects to describe how they would like their work to be cited.
|
||||
The {% data variables.product.company_short %} citation feature will also detect a small number of additional files that are often used by communities and projects to describe how they would like their work to be cited.
|
||||
|
||||
GitHub will link to these files in the _Cite this repository_ prompt, but will not attempt to parse them into other citation formats.
|
||||
{% data variables.product.company_short %} will link to these files in the _Cite this repository_ prompt, but will not attempt to parse them into other citation formats.
|
||||
|
||||
```
|
||||
```text
|
||||
# Note these are case-insensitive and must be in the root of the repository
|
||||
CITATION
|
||||
CITATIONS
|
||||
@@ -186,4 +186,4 @@ inst/CITATION
|
||||
|
||||
We currently support APA and BibTex file formats.
|
||||
|
||||
Are you looking for additional citation formats? GitHub uses a Ruby library, to parse the `CITATION.cff` files. You can request additional formats in the [ruby-cff](https://github.com/citation-file-format/ruby-cff) repository, or contribute them yourself.
|
||||
Are you looking for additional citation formats? {% data variables.product.company_short %} uses a Ruby library, to parse the `CITATION.cff` files. You can request additional formats in the [ruby-cff](https://github.com/citation-file-format/ruby-cff) repository, or contribute them yourself.
|
||||
|
||||
@@ -81,7 +81,7 @@ If any line in your CODEOWNERS file contains invalid syntax, the file will not b
|
||||
|
||||
### Example of a CODEOWNERS file
|
||||
|
||||
```
|
||||
```text
|
||||
# This is a comment.
|
||||
# Each line is a file pattern followed by one or more owners.
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ C# | `nuget`
|
||||
|
||||
Here's an example `FUNDING.yml` file:
|
||||
|
||||
```
|
||||
```yaml
|
||||
github: [octocat, surftocat]
|
||||
patreon: octocat
|
||||
tidelift: npm/octo-package
|
||||
|
||||
@@ -21,7 +21,7 @@ Use a _.gitattributes_ file to mark files that match a given "pattern" with the
|
||||
|
||||
For example, to mark `search/index.json` as a generated file, add this line to _.gitattributes_:
|
||||
|
||||
```
|
||||
```text
|
||||
search/index.json linguist-generated=true
|
||||
```
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ You can also use {% data variables.large_files.product_name_short %} with {% dat
|
||||
|
||||
{% data variables.large_files.product_name_short %}'s pointer file looks like this:
|
||||
|
||||
```
|
||||
```text
|
||||
version {% data variables.large_files.version_name %}
|
||||
oid sha256:4cac19622fc3ada9c0fdeadb33f88f367b541f38b89102a3f1261ac81fd5bcb5
|
||||
size 84977953
|
||||
|
||||
@@ -25,7 +25,7 @@ If collaborators on your repository don't have {% data variables.large_files.pro
|
||||
|
||||
{% data variables.product.product_name %} does not render some {% data variables.large_files.product_name_short %} objects in pull requests. Only the pointer file is shown, with contents similar to the following:
|
||||
|
||||
```
|
||||
```text
|
||||
+version https://git-lfs.github.com/spec/vi
|
||||
+id sha256:7194bdd797bde471a6e29b4fa9c8c2278b3c4dadfc5cb2c36d7f4531dc6cb8f
|
||||
+size 17330
|
||||
|
||||
@@ -332,7 +332,7 @@ jupyter nbconvert --to html NOTEBOOK-NAME.ipynb
|
||||
|
||||
For example, if you add a `.mmd` file with the following content to your repository:
|
||||
|
||||
```
|
||||
```text
|
||||
graph TD
|
||||
A[Friend's Birthday] -->|Get money| B(Go shopping)
|
||||
B --> C{Let me think}
|
||||
|
||||
@@ -19,7 +19,7 @@ A bare term with no qualifiers will match either the content of a file or the fi
|
||||
|
||||
For example, the following query:
|
||||
|
||||
```
|
||||
```text
|
||||
http-push
|
||||
```
|
||||
|
||||
@@ -29,7 +29,7 @@ You can enter multiple terms separated by whitespace to search for documents tha
|
||||
|
||||
For example, the following query:
|
||||
|
||||
```
|
||||
```text
|
||||
sparse index
|
||||
```
|
||||
|
||||
@@ -47,19 +47,19 @@ You can also use regular expressions in your searches by surrounding the express
|
||||
|
||||
To search for an exact string, including whitespace, you can surround the string in quotes. For example:
|
||||
|
||||
```
|
||||
```text
|
||||
"sparse index"
|
||||
```
|
||||
|
||||
To search for a phrase containing a quotation mark, you can escape the quotation mark using a backslash. For example, to find the exact string `name = "tensorflow"`, you can search:
|
||||
|
||||
```
|
||||
```text
|
||||
"name = \"tensorflow\""
|
||||
```
|
||||
|
||||
You can also use quoted strings in qualifiers, for example:
|
||||
|
||||
```
|
||||
```text
|
||||
path:git language:"protocol buffers"
|
||||
```
|
||||
|
||||
@@ -71,19 +71,19 @@ By default, adjacent terms separated by whitespace are equivalent to using the `
|
||||
|
||||
To search for documents containing either one term or the other, you can use the `OR` operator. For example, the following query will match documents containing either `sparse` or `index`:
|
||||
|
||||
```
|
||||
```text
|
||||
sparse OR index
|
||||
```
|
||||
|
||||
To exclude files from your search results, you can use the `NOT` operator. For example, to exclude files in the `__testing__` directory, you can search:
|
||||
|
||||
```
|
||||
```text
|
||||
"fatal error" NOT path:__testing__
|
||||
```
|
||||
|
||||
You can use parentheses to express more complicated boolean expressions. For example:
|
||||
|
||||
```
|
||||
```text
|
||||
(language:ruby OR language:python) AND NOT path:"/tests/"
|
||||
```
|
||||
|
||||
@@ -102,13 +102,13 @@ You can use specialized keywords to qualify your search.
|
||||
|
||||
To search within a repository, use the `repo:` qualifier. You must provide the full repository name, including the owner. For example:
|
||||
|
||||
```
|
||||
```text
|
||||
repo:github-linguist/linguist
|
||||
```
|
||||
|
||||
To search within a set of repositories, you can combine multiple `repo:` qualifiers with the boolean operator `OR`. For example:
|
||||
|
||||
```
|
||||
```text
|
||||
repo:github-linguist/linguist OR repo:tree-sitter/tree-sitter
|
||||
```
|
||||
|
||||
@@ -122,13 +122,13 @@ repo:github-linguist/linguist OR repo:tree-sitter/tree-sitter
|
||||
|
||||
To search for files within an organization, use the `org:` qualifier. For example:
|
||||
|
||||
```
|
||||
```text
|
||||
org:github
|
||||
```
|
||||
|
||||
To search for files within a personal account, use the `user:` qualifier. For example:
|
||||
|
||||
```
|
||||
```text
|
||||
user:octocat
|
||||
```
|
||||
|
||||
@@ -142,7 +142,7 @@ user:octocat
|
||||
|
||||
To narrow down to a specific languages, use the `language:` qualifier. For example:
|
||||
|
||||
```
|
||||
```text
|
||||
language:ruby OR language:cpp OR language:csharp
|
||||
```
|
||||
|
||||
@@ -152,7 +152,7 @@ For a complete list of supported language names, see [languages.yaml](https://gi
|
||||
|
||||
To search within file paths, use the `path:` qualifier. This will match files containing the term anywhere in their file path. For example, to find files containing the term `unit_tests` in their path, use:
|
||||
|
||||
```
|
||||
```text
|
||||
path:unit_tests
|
||||
```
|
||||
|
||||
@@ -160,7 +160,7 @@ The above query will match both `src/unit_tests/my_test.py` and `src/docs/unit_t
|
||||
|
||||
To match only a specific filename (and not part of the path), you could use a regular expression:
|
||||
|
||||
```
|
||||
```text
|
||||
path:/(^|\/)README\.md$/
|
||||
```
|
||||
|
||||
@@ -172,26 +172,26 @@ You can also use some limited glob expressions in the `path:` qualifier.
|
||||
|
||||
For example, to search for files with the extension `txt`, you can use:
|
||||
|
||||
```
|
||||
```text
|
||||
path:*.txt
|
||||
```
|
||||
|
||||
<br>
|
||||
To search for JavaScript files within a `src` directory, you could use:
|
||||
|
||||
```
|
||||
```text
|
||||
path:src/*.js
|
||||
```
|
||||
|
||||
- By default, glob expressions are not anchored to the start of the path, so the above expression would still match a path like `app/src/main.js`. But if you prefix the expression with `/`, it will anchor to the start. For example:
|
||||
|
||||
```
|
||||
```text
|
||||
path:/src/*.js
|
||||
```
|
||||
|
||||
- Note that `*` doesn't match the `/` character, so for the above example, all results will be direct descendants of the `src` directory. To match within subdirectories, so that results include deeply nested files such as `/src/app/testing/utils/example.js`, you can use `**`. For example:
|
||||
|
||||
```
|
||||
```text
|
||||
path:/src/**/*.js
|
||||
```
|
||||
|
||||
@@ -199,14 +199,14 @@ path:src/*.js
|
||||
|
||||
You can also use the `?` global character. For example, to match the path `file.aac` or `file.abc`, you can use:
|
||||
|
||||
```
|
||||
```text
|
||||
path:*.a?c
|
||||
```
|
||||
|
||||
<br>
|
||||
To search for a filename which contains a special character like `*` or `?`, just use a quoted string:
|
||||
|
||||
```
|
||||
```text
|
||||
path:"file?"
|
||||
```
|
||||
|
||||
@@ -218,7 +218,7 @@ You can search for symbol definitions in code, such as function or class definit
|
||||
|
||||
For example, to search for a symbol called `WithContext`:
|
||||
|
||||
```
|
||||
```text
|
||||
language:go symbol:WithContext
|
||||
```
|
||||
|
||||
@@ -226,7 +226,7 @@ In some languages, you can search for symbols using a prefix (e.g. a prefix of t
|
||||
|
||||
You can also use regular expressions with the symbol qualifier. For example, the following query would find conversions people have implemented in Rust for the `String` type:
|
||||
|
||||
```
|
||||
```text
|
||||
language:rust symbol:/^String::to_.*/
|
||||
```
|
||||
|
||||
@@ -249,7 +249,7 @@ We are working on adding support for more languages. If you would like to help c
|
||||
|
||||
By default, bare terms search both paths and file content. To restrict a search to strictly match the content of a file and not file paths, use the `content:` qualifier. For example:
|
||||
|
||||
```
|
||||
```text
|
||||
content:README.md
|
||||
```
|
||||
|
||||
@@ -259,19 +259,19 @@ This query would only match files containing the term `README.md`, rather than m
|
||||
|
||||
To filter based on repository properties, you can use the `is:` qualifier. At this time, `is:` supports two values: `archived`, which restricts the search to archived repositories, and `fork`, which restricts the search to forked repositories. For example:
|
||||
|
||||
```
|
||||
```text
|
||||
path:/^MIT.txt$/ is:archived
|
||||
```
|
||||
|
||||
Note that the `is:` qualifier can be inverted with the `NOT` operator. To search for non-archived repositories, you can search:
|
||||
|
||||
```
|
||||
```text
|
||||
log4j NOT is:archived
|
||||
```
|
||||
|
||||
To exclude forks from your results, you can search:
|
||||
|
||||
```
|
||||
```text
|
||||
log4j NOT is:fork
|
||||
```
|
||||
|
||||
@@ -281,12 +281,12 @@ Code search supports regular expressions to search for patterns in your code. Yo
|
||||
|
||||
For example, to search for the regular expression `sparse.*index`, you would use:
|
||||
|
||||
```
|
||||
```text
|
||||
/sparse.*index/
|
||||
```
|
||||
|
||||
Note that you'll have to escape any forward slashes within the regular expression. For example, to search for files within the `App/src` directory, you would use:
|
||||
|
||||
```
|
||||
```text
|
||||
/^App\/src\//
|
||||
```
|
||||
|
||||
@@ -62,7 +62,7 @@ To do this, create or update a file called `.gitattributes` in your repository r
|
||||
|
||||
For example, the following `.gitattributes` file would cause files in the `build/` directory to be available to the file finder:
|
||||
|
||||
```
|
||||
```text
|
||||
build/** linguist-generated=false
|
||||
```
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ You can also send an email notification to <copyright@github.com>. You may inclu
|
||||
|
||||
If you must send your notice by physical mail, you can do that too, but it will take _substantially_ longer for us to receive and respond to it—and the 10-14 day waiting period starts from when we _receive_ your counter notice. Notices we receive via plain-text email have a much faster turnaround than PDF attachments or physical mail. If you still wish to mail us your notice, our physical address is:
|
||||
|
||||
```
|
||||
```text
|
||||
GitHub, Inc
|
||||
Attn: DMCA Agent
|
||||
88 Colin P Kelly Jr St
|
||||
|
||||
@@ -87,7 +87,7 @@ You can also send an email notification to <copyright@github.com>. You may inclu
|
||||
|
||||
If you must send your notice by physical mail, you can do that too, but it will take _substantially_ longer for us to receive and respond to it. Notices we receive via plain-text email have a much faster turnaround than PDF attachments or physical mail. If you still wish to mail us your notice, our physical address is:
|
||||
|
||||
```
|
||||
```text
|
||||
GitHub, Inc
|
||||
Attn: DMCA Agent
|
||||
88 Colin P Kelly Jr St
|
||||
|
||||
@@ -221,7 +221,7 @@ We will take steps to preserve account records for up to 90 days upon formal req
|
||||
|
||||
Please serve requests to:
|
||||
|
||||
```
|
||||
```text
|
||||
GitHub, Inc.
|
||||
c/o Corporation Service Company
|
||||
2710 Gateway Oaks Drive, Suite 150N
|
||||
|
||||
@@ -2,7 +2,7 @@ You can define relative links and image paths in your rendered files to help rea
|
||||
|
||||
A relative link is a link that is relative to the current file. For example, if you have a README file in root of your repository, and you have another file in _docs/CONTRIBUTING.md_, the relative link to _CONTRIBUTING.md_ in your README might look like this:
|
||||
|
||||
```
|
||||
```text
|
||||
[Contribution guidelines for this project](docs/CONTRIBUTING.md)
|
||||
```
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
To create a task list, preface list items with a hyphen and space followed by `[ ]`. To mark a task as complete, use `[x]`.
|
||||
|
||||
```
|
||||
```markdown
|
||||
- [x] #739
|
||||
- [ ] https://github.com/octo-org/octo-repo/issues/740
|
||||
- [ ] Add delight to the experience when all tasks are complete :tada:
|
||||
|
||||
@@ -21,9 +21,9 @@ export const internalLinkPunctuation = {
|
||||
const content = child.content.trim()
|
||||
const hasPuntuation = isStringPunctuated(content)
|
||||
const hasQuotes = isStringQuoted(content)
|
||||
const range = getRange(line, content)
|
||||
|
||||
if (hasPuntuation || hasQuotes) {
|
||||
const range = getRange(line, content)
|
||||
addError(
|
||||
onError,
|
||||
child.lineNumber,
|
||||
|
||||
Reference in New Issue
Block a user