Git Product home page Git Product logo

language-restructuredtext's Introduction

language-restructuredtext's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

language-restructuredtext's Issues

Highlight not working (possible conflict with another package)

Hi,
highlight of rST syntax stopped working in my Atom, while e.g. completion of directives works just fine.
I guess it could be a conflict with some other community package. Could you please investigate?
I suspect one of those highlight packages (listed below).
Do you have a list of conflicting packages? Just an idea... :)

Atom version: 1.40.1
Community packages installed: badges, busy-signal, highlight-line, highlight-nbsp, intentions, language-latex, language-restructuredtext, linter, linter-ui-default, misc-text-util, pandoc, project-viewer, quick-highlight, rst-preview-pandoc, simple-drag-drop-text, text-tools, underline, xml-tools

multiline comment [feature request]

It would nice to have the ability to highlight multiple lines and then press alt + / to add a .. at the beginning of each line that is highlighted

Section snippets don't work as expected

When I use the section snippets, I type sec, hit tab and then see:

subsection name
${1/(.)|\s/(?1:=:=)/g}

If I continue typing, it replaces "subsection name" with what I type as expected, but the second line just looks like a regular expression.

Link snippet starts with newline, lacks space.

If I add a link in running text using the snippet, e.g. My homepage is at lin<Tab>, there are several issues. First, the snippet starts with a newline, so it autofills to

My homepage is at 
`Title<http://link>`_

which does not look like it's desired.

Second, there is no space between Title and <, which apparently is illegal link markup, so when I fill out the link with bar<Tab>foo.com, my Sphinx complains with ERROR: Unknown target name: "bar<foo.com>". :-( Adding a space after bar fixes the issue, so this probably should be made part of the snippet?

Third, after filling the Title and URL, I would have expected another <Tab> to jump the cursor to after the snippet so that I can continue typing, but this only adds a tab-space after the URL. Am I using this wrong, or is this a bug?

This is with version 0.10.0, on Atom 1.3.0.

Standalone URL highlighting stops at first underscore

e.g. Opening this file https://github.com/peterjc/galaxy_blast/blob/2c44d9e2346b18ebb0046121dbb44e4189a6d6ff/README.rst in Atom with default settings the URLs are in purple, however, there is a problem when there is an underscore in the URL, e.g.

...

The main focus of this work is the development of the NCBI BLAST+ command line
tool wrappers and datatype definitions for Galaxy, published on the Galaxy
Tool Shed here:

* http://toolshed.g2.bx.psu.edu/view/devteam/ncbi_blast_plus/
* http://toolshed.g2.bx.psu.edu/view/devteam/blast_datatypes/

...

Bug Reports
===========

You can file an issue here https://github.com/peterjc/galaxy_blast/issues or ask
us on the Galaxy development list http://lists.bx.psu.edu/listinfo/galaxy-dev

...

Here only http://toolshed.g2.bx.psu.edu/view/devteam/ncbi is purple, with _blast_plus/ in normal text color. Likewise with the other URLs with an underscore (not just in bullet lists, but also in plain text paragraphs).

Update: Tested with Atom 1.2.4 with language-restructuredtext v0.10.0 under Mac OS X 10.10.5

markdown-preview stops working after installing language-restructuredtext

Is there a way to let these two packages work together to preview .rst files?

Thanks

Atom Version: 1.9.0-beta0
System: Mac OS X 10.11.2

Config

{
  "core": {
    "allowPendingPaneItems": false,
    "disabledPackages": [
      "language-python",
      "symbols-tree-view"
    ],
    "ignoredNames": [
      ".*",
      "*~",
      "*.pdf",
      "*.png",
      "*.pyc",
      "*.npz"
    ],
    "openEmptyEditorOnStart": false
  },
  "linter": {}
}

Installed Packages

# User
atomic-emacs, v0.9.1 (active)
file-watcher, v0.4.0 (active)
language-cython, v0.3.0 (active)
language-restructuredtext, v0.16.0 (active)
linter, v1.11.7 (active)
linter-flake8, v1.13.0 (active)
linter-markdown, v1.5.2 (active)
MagicPython, v0.5.11 (active)
markdown-scroll-sync, v2.1.2 (active)
markdown-writer, v2.3.4 (inactive)
minimap, v4.24.4 (active)
minimap-cursorline, v0.2.0 (active)
symbols-tree-view, v0.13.2 (inactive)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.51.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.43.0 (inactive)
base16-tomorrow-dark-theme, v1.1.0 (inactive)
base16-tomorrow-light-theme, v1.1.1 (inactive)
one-dark-ui, v1.3.2 (active)
one-light-ui, v1.3.2 (inactive)
one-dark-syntax, v1.2.0 (active)
one-light-syntax, v1.2.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (inactive)
about, v1.5.2 (active)
archive-view, v0.61.1 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.11.1 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.0 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (active)
background-tips, v0.26.0 (active)
bookmarks, v0.41.0 (active)
bracket-matcher, v0.82.1 (active)
command-palette, v0.38.0 (inactive)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.38.1 (active)
fuzzy-finder, v1.2.0 (active)
git-diff, v1.0.1 (active)
find-and-replace, v0.198.0 (inactive)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.1 (active)
image-view, v0.58.0 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.1 (inactive)
markdown-preview, v0.158.0 (active)
metrics, v0.53.1 (active)
notifications, v0.64.1 (active)
open-on-github, v1.1.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.238.0 (active)
snippets, v1.0.2 (active)
spell-check, v0.67.1 (active)
status-bar, v1.3.1 (active)
styleguide, v0.46.0 (active)
symbols-view, v0.113.0 (inactive)
tabs, v0.98.0 (active)
timecop, v0.33.1 (active)
tree-view, v0.208.0 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.34.0 (active)
whitespace, v0.32.2 (active)
wrap-guide, v0.38.1 (active)
language-c, v0.52.1 (active)
language-clojure, v0.21.0 (active)
language-coffee-script, v0.47.0 (active)
language-csharp, v0.12.1 (active)
language-css, v0.36.2 (active)
language-gfm, v0.86.0 (active)
language-git, v0.13.0 (active)
language-go, v0.42.0 (active)
language-html, v0.44.1 (active)
language-hyperlink, v0.16.0 (active)
language-java, v0.22.0 (active)
language-javascript, v0.119.0 (active)
language-json, v0.18.0 (active)
language-less, v0.29.3 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.35.0 (active)
language-php, v0.37.0 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.0 (inactive)
language-ruby, v0.68.5 (active)
language-ruby-on-rails, v0.25.0 (active)
language-sass, v0.52.0 (active)
language-shellscript, v0.22.3 (active)
language-source, v0.9.0 (active)
language-sql, v0.21.1 (active)
language-text, v0.7.1 (active)
language-todo, v0.28.0 (active)
language-toml, v0.18.0 (active)
language-xml, v0.34.8 (active)
language-yaml, v0.26.0 (active)

# Dev
No dev packages

Package.loadSettings is deprecated.

Store package settings files in the settings/ directory instead of scoped-properties/

Package.loadSettings (/Applications/Atom.app/Contents/Resources/app/src/package.js:565:9)
<unknown> (/Applications/Atom.app/Contents/Resources/app/src/package.js:187:43)

After updating to 0.16, the syntax highlighting color of sections disappear.

The color of the section part used to be green, but changing to white after updating to 0.16.
Is it the intended result?

See the window on the left.
screenshot from 2016-06-11 00-19-36

Window on the right is how markdown code was rendered and it is what I'm expecting.

Another screenshot
screenshot from 2016-06-11 00-29-09

I'm using

language-restructuredtext 0.16.0
Atom 0.18
Fedora 23

Snippets not working

When I type snippets (e.g. the default image or link), they will not be completed. From Sublime Text I'm used that you have to explicitly enable snippets for the text scope, but since HTML snippets work in Atom, I don't suspect that's the case. Any idea why they don't work?

Text under heading displayed in blue ?

For some times now the text just under an header is displayed in blue color. Is this intentional ? Seems it didn't do that in the past . Not a big issue, but hinder a little the readability of the page.

Capture d’écran_2020-06-25_14-13-34

python code blocks are mishandled by the restructuredtext package

your atom package is marking embedded Python blocks as full Python code (source.python) instead of embedded Python (source.embedded.python)

if you were to open this rst from within Atom:
https://raw.githubusercontent.com/YosaiProject/yosai/master/doc/authorization.rst

scopes at cursor at line 127 shows the following:
text.restructuredtext source.gfm.restructuredtext
meta.paragraph.restructuredtext
source.python
meta.function-call.python
meta.function-call.arguments.python
invalid.illegal.operator.python

please note that I raised this as an issue in the atomlinter project:
AtomLinter/linter-flake8#139 (comment)

Use of "<<" permanently turns on monospaced highlighting

Consider the following example .rst file:

Paragraph 1

``monospaced``

.. code-block:: sh

    $ cat >py.sh <<EOT
    #!/bin/bash
    py=$(which python)
    $py "$@"
    EOT

``monospaced``

Paragraph 2

Atom when using this package highlights this incorrectly. Anything after the << gets highlighted in green (same as text in double backquotes). Usage of double backquotes after that does not reset this highlighting.

Screen shot how the above file is highlighted:

Screenshot 2021-12-14 at 11 40 46

When I remove one of the two < characters, the highlighting is correct again, so this is clearly triggered by the presence of two <<:

Screenshot 2021-12-14 at 11 43 25

Method references in Java Code Blocks break highlighting

Everything after a java code block containing a method reference is highlighted as if it were java code.

Example of breaking code block:

.. code-block:: java

    String someString = getOptionalString().orElseThrow(IllegalArgumentException::new);

Add more snippets

Would it be possible to add support for more snippets ? For example, it would be nice to have snippet autocompletion for directives and roles described in this cheatsheet.

syntax highlight issues for backslash inside double backquote

Following snippet is valid sphinx, but produce annoying warning highlights.

It considers any of ``\r``, ``\n``, and ``\r\n`` to be newlines.
Because of the ambiguity of an append operation ending in the character ``\r`` (it may be a bare ``\r`` or half of ``\r\n``), the last line of such an append operation will be buffered until the next append or flush.

Syntax Highlighting won't stop in indented blocks

I stumbled over this issue when I tied to use a code block inside a glossary block.
This compiles just fine with sphinx - but the atom language grammar keeps the syntax highlighting to that language until the next line that begins with no indent.

012

Same issue when just using indented blocks:

    Indented Block...
    .. code-block:: java

        Point a = new Point();

    Other stuff in indented block...

Works fine again...

autocompletion

Hi,

autocompletion does not work for me, when your package is active.

That is, it does work if I type "le..." for example - but not for anything else...

Any help?

screenshot

link definition may contain colon or plus sign

The reStructuredText Markup Specification has the following to say about reference names for links:

Simple reference names are single words consisting of alphanumerics plus isolated (no two adjacent) internal hyphens, underscores, periods, colons and plus signs; no whitespace or other characters are allowed

The highlighter currently does not allow colon or plus (which the spec says is valid), but it does allow spaces, parentheses and forward slash (which are invalid according to the spec).
I can understand that it might allow a bit more characters than the spec, but I'm missing highlighting when I use a colon (e.g. as a separator: .. _figure:this-is-my-figure:).

Syntax highlighting for raw directive

I noticed the rule for raw directive syntax highlighting is not right. For example, the correct way to write something in raw html is:

.. raw:: html

    <iframe src="https://google.com"></iframe>

However, in atom this won't trigger the html syntax highlighting, which only happens when i write like this (without the blank line, which is incorrect):

.. raw:: html
    <iframe src="https://google.com"></iframe>

Not able to set tab length to 2 if main settings are different

In my main settings I have a tab length of 4.
In reStructuredText I want a tab length of 2 which is actually the default.
But when I enter a tab length of 2 or also when I enter nothing it got changed to 4.
Other values are excepted.
I think this is the case, because 2 is the default value which gets overridden by the main settings.

Please add support for a few more Sphinx extensions

(I was directed over here because Github uses TextMate-style language grammars through the linguist project (https://github.com/github/linguist/ ) and linguist points (https://github.com/github/linguist/tree/master/vendor/grammars ) to the language-restructuredtext project)

Could support for a few more Sphinx extensions be added? Over on https://gist.github.com/sitsofe/5610dafcddc5c89c8dbb9e5d3bce668d#job-description the one that is most problematic is the .. option:: directive (http://www.sphinx-doc.org/en/stable/domains.html?highlight=option#directive-option ). There are few others such as the :option: inline markup (http://www.sphinx-doc.org/en/stable/markup/inline.html#role-option ) and :manpage: inline markup (http://www.sphinx-doc.org/en/stable/markup/inline.html?highlight=manpage#role-manpage ) but those are more minor...

Spell checking

Markdown documents have spell checking enabled by default. It would be great if rst documents were given the same treatment.

For now, my workaround is to switch the grammar to markdown periodically.

rst not recognized as rst when headings skip a level

not sure whether it's the right place to file this but looks like this repo is what's used to highlight rst in GitHub, I've also filled this in github/markup#1446

this won't render as rst:

Heading1
========

Heading2
--------

Heading3
~~~~~~~~

Heading4
========

Heading5
~~~~~~~~

this will:

Heading1
========

Heading2
--------

Heading3
~~~~~~~~

Heading4
========

Heading4b
---------

Heading5
~~~~~~~~

See github/markup#1446 for details.

Dynamic-size underline for section snippets

Follow up on #5:

Commit 7897d5b replaced the non-working regexes with fixed-size underline, rendering these snippets more useful in the short term. However, ideally we would like to have the underlines be generated dynamically: the number of underline characters should be the same as the section name's length.

That would likely require a post-snippet-editing mechanism be added to the snippet package?

Keep indentation

When I'm editing blocks of text -- especially with Sphinx docs -- it's annoying that the indentation isn't kept, leading to me having to re-indent after every newline instead of un-indenting when I'm finally done.

Package.loadSettings is deprecated.

Store package settings files in the settings/ directory instead of scoped-properties/

Package.loadSettings (/Applications/Atom.app/Contents/Resources/app/src/package.js:547:9)
<unknown> (/Applications/Atom.app/Contents/Resources/app/src/package.js:168:43)

Would you attach a screenshot of how does it look like?

I'm from Sublime and I'm looking for some equivalent highlighter of this:

sblime

But when I open the same file in Atom, I got this:

atom

I'm not sure if I did something wrong. Would you please attach a screenshot of the standard expected behavior? Thanks.

Styling for default Atom themes

issue #9 refers.

I am very new to Atom, but a regular rst user. I'd appreciate if there were some way to have the same type of elements "coded" in some way across all the default Atom themes.

In particular, when you compare the normal light theme vs solarized light (which I use because its not as harsh in contrast as most of the others), you can see that styling is not the same between them; code in backticks is not styled nor is code text in indented blocks.

I am not sure how or where to begin to make any changes to make this work?

light

solarized-light

Live update flashing

When I enabled live update, whenever I changed the source file, the preview panel flashes with a github symbol and "loading rst", which becomes very distractive and I had to disable the live update mode. Are there any ways to disable the loading icon or bind a keystroke to update preview? (All I can find is rst preview: toggle, I want something like rst preview: update)

Add math markup highlighting

Similar to language-pfm, it would be nice to have math scope + highlighting in .. math: blocks and :math: inline.

Directives with domains names are not parsed correctly

Directives with domains like theses:

.. py:functions:: foo(bar) 

.. cpp:class:: Name

are parsed and highlighted as comments.

The same issue seems to appears with the Github highlighting:

.. code::

.. py:class:: Test

Choice of scope

I was wondering what made you choose .gfm.restructuredtext as scope name. If reStructuredText was GFM-based (GitHub Flavoured Markdown), the natural choice would be .source.gfm.restructuredtext. Since it isn't, I'd suggest using .text.restructuredtext instead (maybe .source.restructuredtext). Your scope name works, it's just that it seems an odd choice.

See this comparison of Sublime Text and Atom scopes

Highlight markups with line breaks

Highlighting won't continue when there's a line break. See:

captura de tela de 2017-12-30 01-49-53

As they produce the same output, I guess they should be marked the same on the editor.

captura de tela de 2017-12-30 01-50-10

Syntax highlighting for headings

Right now headings are not highlighted and only have the scope text.restructuredtext. Please add additional scopes to allow syntax highlighting: heading.markup.restructuredtext for all headings, and heading-#.restructuredtext where # is the pertinent numbered heading.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.