Skip to content

Add option to emit Annotated Source (and units) in Markdown format #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
delphidabbler opened this issue Dec 23, 2022 · 7 comments
Closed
Assignees
Labels
feature request Request for a new feature rejected Won't implement or fix

Comments

@delphidabbler
Copy link
Owner

delphidabbler commented Dec 23, 2022

There's already the option to format annotated source code in RTF and XHTML.

Being able to render the source in Markdown format could be useful too.

@delphidabbler delphidabbler self-assigned this Dec 23, 2022
@delphidabbler delphidabbler added feature request Request for a new feature considering Issue under consideration. May be accepted or rejected accepted Accepted for implementation / fixing and removed considering Issue under consideration. May be accepted or rejected labels Dec 23, 2022
@delphidabbler delphidabbler moved this to To do in CodeSnip May 23, 2023
@delphidabbler
Copy link
Owner Author

delphidabbler commented Oct 23, 2024

There's already the option to format annotated source code in RTF and XHTML.

While annotated source can be written to file in both XHTML & RTF only RTF is used in writing to the clipboard.

Since there is no special Markdown clipboard format that I can find, there's no way of writing Markdown to the clipboard without overwriting the plain text format version.

@delphidabbler
Copy link
Owner Author

I'm wondering whether there's any point saving annotated source or units in Markdown format. Since only compilable Pascal is saved in either case, there's very little different between the plain text version and the Markdown version.

For example, take the annotated source code for the ArrayToStringList snippet, when saved in plain text format. It is

{
 * This code snippet was generated by DelphiDabbler CodeSnip Release 4.23.0 on
 * Wed, 23 Oct 2024 08:22:05 GMT.
 * 
 * It includes code taken from the DelphiDabbler Code Snippets database that is
 * copyright © 2005-2024 by Peter Johnson & Contributors and is licensed under
 * the MIT License (https://opensource.org/licenses/MIT).
}

{
  Required unit(s):
    Classes
}

{
  Copies the elements of string array Strings to string list SL, replacing any
  existing contents of SL.
}
procedure ArrayToStringList(const Strings: array of string;
  const SL: Classes.TStrings);
var
  Idx: Integer; // loops thru each string in array
begin
  SL.Clear;
  for Idx := 0 to Pred(Length(Strings)) do
    SL.Add(Strings[Idx]);
end;

whereas the Markdown equivalent, would be exactly the same as above except it would be wrapped in triple backtick (```) tokens .

@delphidabbler
Copy link
Owner Author

I'm wondering whether there's any point saving annotated source or units in Markdown format. Since only compilable Pascal is saved in either case, there's very little different between the plain text version and the Markdown version.

Because of the above I'm moving this issue back to "considering".

@delphidabbler delphidabbler added considering Issue under consideration. May be accepted or rejected and removed accepted Accepted for implementation / fixing labels Jan 23, 2025
@delphidabbler delphidabbler moved this from Accepted to Considering in CodeSnip Jan 23, 2025
@delphidabbler
Copy link
Owner Author

Another point against implementation is that to render a view from the save dialogue boxes, a Markdown to HTML converter would be needed. To render highlighted wouldn't use the CodeSnip highlighter but would need a third party add in that worked with HTML (maybe in JavaScript).

It is an option that the preview button would be disabled or that raw Markdown would be displayed as plain text.

Finally, how would Markdown be rendered? Should the code fencing use plain text fencing:

```
code
```

or annotated fencing?

```pascal
code
```

@delphidabbler
Copy link
Owner Author

Markdown format might be more appropriate for saving snippet information, with the File | Save Snippet Information option? Note: as this issue is created this menu option is not released, but is in the develop branch.

@delphidabbler
Copy link
Owner Author

Markdown format might be more appropriate for saving snippet information, with the File | Save Snippet Information option? Note: as this issue is created this menu option is not released, but is in the develop branch.

See isssue #155 which proposes this option.

@delphidabbler
Copy link
Owner Author

All in all, there isn't much point in implementing this issue now that the File | Save Snippet Information option has been proposed in issue #155.

So, I'm rejecting this issue.

@delphidabbler delphidabbler added rejected Won't implement or fix and removed considering Issue under consideration. May be accepted or rejected labels Apr 19, 2025
@delphidabbler delphidabbler removed this from CodeSnip Apr 19, 2025
@delphidabbler delphidabbler closed this as not planned Won't fix, can't repro, duplicate, stale Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature rejected Won't implement or fix
Projects
None yet
Development

No branches or pull requests

1 participant