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

Documentation: Update formatting of Lucene.Net and port code sample #232

Closed
wants to merge 2 commits into from

Conversation

stevetemple
Copy link
Contributor

  1. Currently the code sample won't compile in Lucene.NET it's still the java syntax. I have updated to and tested this in C#
  2. Also some formatting had been lost in translation, I have corrected the formatting

Currently the code sample won't compile in Lucene.NET it's still the java syntax. 
Also some formatting had been lost in translation
@stevetemple stevetemple changed the title Update doc formatting and code sample Documentation: Update formatting of Lucene.Net and port code sample Nov 13, 2019
@Shazwazza
Copy link
Contributor

Hi @stevetemple this is great! Like I mentioned in the other PR #231 we'll need to find a way specifically to deal with code snippets when running the tool to transform from the Java source to the .net docs. This is on my todo list to figure out the best approach for this.

I think what it will come down to is being able to parse out their inline code snippets during transformation and then looking for replacement snippets that exist in another file that we manage in our source that replaces it. Or something along those lines.

That part of the transform process isn't quite in place yet

@stevetemple
Copy link
Contributor Author

I started to look at this.

I'm thinking we could have a folder structure that mirrors the javadoc one, and put files in there let's say codesample-1.cs and codesample-2.cs. We could then swap the first code sample with codesample-1.cs and 2nd with codesample-2.cs etc.

The 2 problems I see with this. The currently Html2Markdown version encodes pre as just exact markup rather than a code sample. So there is no way of spotting code samples post conversion. It needs to be done pre/during conversion. The latest Html2Markdown has a way of overriding the behaviour, upgrading to that and having code that jumps in and replaces <pre class="prettyprint"></pre> samples should be possible. We could also then put in some sort of markup to indicate this is the original java code sample where a c# version can't be found.

How does that sound? I've seen a comment in the code somewhere saying the latest Html2Markdown breaks some conversion.

@Shazwazza
Copy link
Contributor

Hi @stevetemple I think if you would like to make a proof of concept/prototype to see how this could work it will be a good start. We will need to do something so any start on this would be good and then can iterate from there. IIRC the Html2Markdown latest version isn't an issue anymore ... but its been a while since i looked into it.

I did recently update the docs converter to ensure that bold and italics were done correctly by implementing a custom IScheme, you can see the changes here #230, the custom IScheme is here https://github.com/apache/lucenenet/pull/230/files#diff-45541bf79c42108aca6173ab1c872005

I need to get that PR merged soon... just got too busy recently but should prob just merge

@stevetemple
Copy link
Contributor Author

Well it seems like I've at least solved your TODO!

I will try and get a prototype together today, I'll base it off the #230 branch.

@Shazwazza
Copy link
Contributor

Just posting this link here so its not lost, this was a writeup about an idea of how to possibly handle code blocks going forward #229 (comment)

I have some other ideas too but nothing concrete at the moment.

As I make more changes (see current WIP #235) i'll try to get my head back into this challenge.

@Shazwazza Shazwazza closed this Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants