Skip to content
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

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

Open
delphidabbler opened this issue Dec 23, 2022 · 2 comments
Open
Assignees
Labels
accepted Accepted for implementation / fixing feature request Request for a new feature

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 since 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 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Accepted for implementation / fixing feature request Request for a new feature
Projects
Status: Accepted
Development

No branches or pull requests

1 participant