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

Improve search behavior for specific keywords #25037

Merged
merged 2 commits into from
May 21, 2024

Conversation

mppf
Copy link
Member

@mppf mppf commented May 14, 2024

This PR improves the documentation search results for specific searches:

  • new
  • with
  • by
  • zip
  • local

In order to do so, it adds .. index:: entries to the forallLoops.chpl and taskParallel.chpl primers. I added index entries for other sections present there, while there. To get these .. index:: entries to work, I needed to update literate_chapel.py because it was de-indenting the lines following .. index:: which lead to invalid RST.

This PR also has a minor impact on the Chapel blog rendering (since the blog uses chpl2rst.py which this PR modifies to support .. index::). Now whitespace is more accurately respected within the .rst comments.

Reviewed by @DanilaFe - thanks!

  • full comm=none testing

mppf added 2 commits May 14, 2024 11:16
---
Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
---
Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
@mppf mppf requested a review from DanilaFe May 14, 2024 15:19
Comment on lines +83 to +86
if commentstarts > 0:
# reset indentation at the start of a block comment
#indentation = -1;
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dead / debugging code?

@@ -102,21 +107,25 @@ def push_line(line):
# No need for trailing white space... ever
proseline = proseline.rstrip(' ')

# Handle indentation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing that literate_chapel.py is also used for the blog so it would be good to make sure that none of the blog Markdown conversions are affected.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you suggest how I can go about doing that?

Copy link
Contributor

@DanilaFe DanilaFe May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you would:

  1. Follow the steps in the README to build the main branch of chapel-blog with CHPL_HOME pointed to a version of the repo right before this PR
  • This would involve running ./scripts/chpl_blog.py build in the blog repo
  1. Preserve the public directory by renaming it to something (public-old)
  2. Going back to the Chapel repo at $CHPL_HOME, check out this PR; run build again
  3. Do a diff on public-old and old.

Copy link
Member Author

@mppf mppf May 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are whitespace changes but I think they're innocuous and the new result is more accurate.

An example, with this input within a comment:

/*
### First Solution: Hand-coded Interval Arithmetic
Here is a succinct solution for both parts in Chapel.

```Chapel
  use IO;

  var sumSubset = 0;
...

Now there are spaces in the visible code listing before the use and var lines.

This problem only affects 2 posts: aoc2022-day04-ranges (source of the above example) and netcdf1 (which has a minor difference that seems to be an improvement).

@mppf mppf merged commit 714f9c2 into chapel-lang:main May 21, 2024
7 checks passed
@mppf mppf deleted the keyword-search-improvements branch May 21, 2024 18:56
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.

None yet

2 participants