retext-project / retext

ReText: Simple but powerful editor for Markdown and reStructuredText
GNU General Public License v2.0
1.85k stars 198 forks source link

ReText 7.2.1 on Windows: Edit->Preferences creates markdown-extensions.txt in wrong folder #567

Open UNIVAC-Colonel-Panic opened 3 years ago

UNIVAC-Colonel-Panic commented 3 years ago
  1. Edit->Preferences->Markdown syntax extensions ... -- if the field is blank and then filled in, it creates markdown-extensions.txt in

%appdata%\markdown-extensions.txt

instead of

%appdata%\ReText project\markdown-extensions.txt

But ReText seems to ignore what's in %appdata%\markdown-extensions.txt. For example, if I put toc in "Markdown syntax extensions...", exit and relaunch ReText, go to Edit->Preferences, the toc is still there but putting [TOC] into an actual markdown file doesn't trigger the TOC to be rendered by the preview.

The workaround I'm using for now is to move markdown-extensions.txt into %appdata%\ReText project\.

  1. The Wiki article for Enabling extensions globally states:

If you want some extensions applied to all documents, list them in $HOME/.config/markdown-extensions.txt file. You can also use the “Markdown extensions” field in the Preferences dialog to edit that file.

I realize the above path is for non-Windows platforms, but I'm not sure what it needs to be changed to. I'm mentioning to merely point out that the Wiki probably needs to be changed.

mitya57 commented 3 years ago

No, markdown-extensions.txt file should be not in ReText project, it should be directly in %appdata%. ReText uses the same path when it creates the file and when it reads it to get the extensions names.

It may be the problem that the changes do not immediately take effect: you may need to close the document and open it again. Can you please try that?

UNIVAC-Colonel-Panic commented 3 years ago

Yes, I did try that as well as closing ReText itself and relaunching. Still no go.

When I first tried figuring out the problem I looked at ReText.ini but didn't see markdown-extensions.txt.

What would you like me to try next?

mitya57 commented 3 years ago

Can you launch ReText using python.exe instead of pythonw.exe and check if it prints any errors to the console?

Also, can you paste an example of Markdown file where the TOC extension does not work, and the HTML you get (from Edit → View HTML code)?

UNIVAC-Colonel-Panic commented 3 years ago

No errors when launching with python.exe, just a line showing the path to the config file.

[TOC]

# Sagan Ipsum

Flatland! Hypatia. Galaxies Orion's sword globular star cluster? Light years quasar as a patch of light gathered by gravity Vangelis radio telescope. Stirred by starlight vanquish the impossible Tunguska event cosmic fugue courage of our questions worldlets galaxies birth colonies. Vastness is bearable only through love.

# Pirate Ipsum

Lookout flogging bilge rat main sheet bilge water nipper fluke to go on account heave down clap of thunder. Reef sails six pounders skysail code of conduct sloop cog Yellow Jack gunwalls grog blossom starboard. Swab black jack ahoy Brethren of the Coast schooner poop deck main sheet topmast furl marooned.

# Cheese Ipsums

## The First

Cheese on toast airedale the big cheese. Danish fontina cheesy grin airedale danish fontina taleggio the big cheese macaroni cheese port-salut. Edam fromage lancashire feta caerphilly everyone loves chalk and cheese brie. Red leicester parmesan cheese and biscuits cheesy feet blue castello cheesecake fromage frais smelly cheese.

## The second

Melted cheese goat stilton. Fromage cream cheese bocconcini macaroni cheese ricotta parmesan cheese slices babybel. Ricotta halloumi everyone loves caerphilly cheeseburger danish fontina emmental smelly cheese. Swiss the big cheese.

# Baseball Ipsum

Baseball ipsum dolor sit amet cellar rubber win hack tossed. Slugging catcher slide bench league, left fielder nubber. Bullpen blue run rotation relief pitcher grass umpire. Forkball bullpen suicide squeeze club bush league field sport. Base cookie triple play blue hot dog relay rake starting pitcher inning.
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="generator" content="ReText 7.2.1">
<title>example</title>
</head>
<body>
<p>[TOC]</p>
<h1>Sagan Ipsum</h1>
<p>Flatland! Hypatia. Galaxies Orion's sword globular star cluster? Light years quasar as a patch of light gathered by gravity Vangelis radio telescope. Stirred by starlight vanquish the impossible Tunguska event cosmic fugue courage of our questions worldlets galaxies birth colonies. Vastness is bearable only through love.</p>
<h1>Pirate Ipsum</h1>
<p>Lookout flogging bilge rat main sheet bilge water nipper fluke to go on account heave down clap of thunder. Reef sails six pounders skysail code of conduct sloop cog Yellow Jack gunwalls grog blossom starboard. Swab black jack ahoy Brethren of the Coast schooner poop deck main sheet topmast furl marooned.</p>
<h1>Cheese Ipsums</h1>
<h2>The First</h2>
<p>Cheese on toast airedale the big cheese. Danish fontina cheesy grin airedale danish fontina taleggio the big cheese macaroni cheese port-salut. Edam fromage lancashire feta caerphilly everyone loves chalk and cheese brie. Red leicester parmesan cheese and biscuits cheesy feet blue castello cheesecake fromage frais smelly cheese.</p>
<h2>The second</h2>
<p>Melted cheese goat stilton. Fromage cream cheese bocconcini macaroni cheese ricotta parmesan cheese slices babybel. Ricotta halloumi everyone loves caerphilly cheeseburger danish fontina emmental smelly cheese. Swiss the big cheese.</p>
<h1>Baseball Ipsum</h1>
<p>Baseball ipsum dolor sit amet cellar rubber win hack tossed. Slugging catcher slide bench league, left fielder nubber. Bullpen blue run rotation relief pitcher grass umpire. Forkball bullpen suicide squeeze club bush league field sport. Base cookie triple play blue hot dog relay rake starting pitcher inning.</p>

</body>
</html>

Screen capture showing "toc" in preferences:

image

mitya57 commented 3 years ago

It's quite strange. Can you please also:

If you can't do this debugging then no problem, I will try to test myself on a Windows machine but it won't be fast.