How to completely disable any syntax style preview in Source Mode

Hi, I would like to be able to edit in Source Mode with pure text without any preview style formatting But I can’t figure out how to do it.
I saw that it was asked about the same thing in another post but I didn’t understand the solution cause it required installing a certain theme.
Thanks

If you are referring to this thread:

that was more about indentation and spacing in Source mode.

To switch to Source mode, there are a few ways to do it.

Command palette (cmd/ctrl+p):

Three vertical dots: in the upper right:

If Settings > Editor → Editor status is enabled, in the lower right status bar:

1 Like

Sorry maybe I didn’t explain well, I didn’t ask how to enter in source mode. I am already in source mode. My problem is just that source mode keeps previewing some markdown formatting styles and I wont to avoid it. Headings are shown as # Heading but enlarged, bold text is shown as text but bolded, links are colored, lists have the indentations, codes have a different font and background color… And so on… This means that in source mode there is still style formatting. I don’t want that. I want to see markdown text as pure text, as if it were written in windows notepad, you know what I mean?

Any use:

Good set of links eightning, thanks!

@franksisco Apologies, yes of course you know how to switch viewing modes. I now realize we’ve talked about CSS before. :cold_sweat:

I think what you’re looking for is indeed the first link I posted using either the snippet or Oliver’s theme. Or maybe one of the plugins eightning linked could work?

I’ve updated the snippet to remove bold/italic decoration, remove the color from links, and remove the color from code blocks.

https://forum.obsidian.md/t/plugin-theme-for-plain-editing-view-source-mode-text/62435/2

Do you have to disable formatting for each element separately? How about tags?

Always something! Thanks. Updated.

@ariehen yes maybe that’s the right direction and I thank you but I think what I’m looking for is more radical. I really would like to see no syntax style at all. It seems really strange to me that Obsidian doesn’t have an option to simply disable any style in “source mode”. Getting there from a snippet can be endless work.

Anyway using the snippet from your link I see the following problems:
The change also affects the “Reading view”.
Headings have bold style
#tags have a style
Bold syntax has bold style
Italic syntax has italic style
Bold italic syntax has bold italic style
Code block syntax shown with indentation and monospace font.
# symbol has a different color than regular text.
The numbers and list symbols have a different color than regular text.
> has indentation and a different color than tregular text.
~~ ~~ syntax shown as strikethrough style
[[]] has a different color than regular text.

I’m not sure if I used the right snippet, though. but I don’t see them In the link you gave me you talk about update1 and update2 but I only see this:

/*- all things equal -*/
body {
  --h1-size: 1em;
  --h2-size: 1em;
  --h3-size: 1em;
  --h4-size: 1em;
  --h5-size: 1em;
  --h6-size: 1em;

  --h1-line-height: 1.2;
  --h2-line-height: 1.2;
  --h3-line-height: 1.2;
  --h4-line-height: 1.2;
  --h5-line-height: 1.2;
  --h6-line-height: 1.2;

  --list-indent: 1em;

  --h1-weight: 600;
  --bold-weight: 600;

  --link-color: var(--text-normal);
  --link-color-hover: var(--text-normal);
  --link-external-color: var(--text-normal);
  --link-external-color-hover: var(--text-normal);
  --link-unresolved-color: var(--text-normal);

  --tag-color: var(--text-normal);

  --text-highlight-bg-rgb: 192,192,192;
 
  --code-normal: var(--text-normal);
  --code-comment: var(--text-normal);
  --code-function: var(--text-normal);
  --code-important: var(--text-normal);
  --code-keyword: var(--text-normal);
  --code-operator: var(--text-normal);
  --code-property: var(--text-normal);
  --code-punctuation: var(--text-normal);
  --code-string: var(--text-normal);
  --code-tag: var(--text-normal):
  --code-value: var(--text-normal);
  --code-background: none;
}

/*- no color for numbers in code blocks -*/
.markdown-source-view.mod-cm6 .cm-line.HyperMD-codeblock > *, 
.token.number {
  color: var(--text-normal);
}

/*- no italic style -*/
.cm-em, em {
  font-style: normal;
  font-weight: 600;
}

/*- monospace font for all editor views -*/
.markdown-source-view.mod-cm6 .cm-scroller, .markdown-preview-view {
  font-family: 'JetBrains Mono'; 
}

The snippet was originally written up for someone looking for monospace fonts and uniform indentation/spacing. That was it. I had thought maybe you could find it useful.

While it’s meant to be used in Source mode, nothing in the CSS is really targeting only Source mode, so that’s to be expected. You could use something like MySnippets to quickly turn OFF the snippet when you switch to Live Preview or Reading views.

I updated the original by adding a few things, so there’s only one version now which you’ve posted here. It’s the latest.

Ha! Yes, as mentioned, it was originally for another purpose and it’s a snippet I won’t use myself, so I didn’t check everything. If I have time, I’ll write up one targeting only Source mode, including the bits you mentioned above, and link it here. Maybe something for Share & Showcase:thinking:

You could give this one a try:

2 Likes

Wow! You really did a great job! Thank you so much. I have a couple of things to ask but I’ll do it in that post

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.