You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/02/22 09:26:15 UTC

[GitHub] [ozone] JyotinderSingh opened a new pull request #3122: HDDS-6361. Modify docs build flow to replace image tags with shortcodes.

JyotinderSingh opened a new pull request #3122:
URL: https://github.com/apache/ozone/pull/3122


   ## What changes were proposed in this pull request?
   
   Currently, if we want to add responsive images to the documentation website, we must use a Hugo shortcode introduced in [HDDS-6073](https://issues.apache.org/jira/browse/HDDS-6073) (#2898).
   
   This looks like:
   
   ```
   {{< image src="image-name.png">}} 
   ```
   
   While this shortcode gets converted into an HTML `img` in the production build after running `hugo -d`, IDEs and GitHub are not able to parse this as an image and make it harder to review pull requests when this format is used.
   
   This Jira introduces a python script that will be called as a part of the maven build process, which will automatically replace all markdown images with their respective shortcodes - allowing developers to use familiar native markdown syntax (readable by GitHub and IDEs).
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-6361
   
   ## How was this patch tested?
   
   Ran `mvn clean install`.
   
   `hadoop-hdds/docs/target/classes/docs/*` HTML files contain images with the correct `img` tags:
   ```
   <img src='PrefixFSO-Rename.png' alt='Prefix FSO Rename' class="img-responsive"/>
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] JyotinderSingh commented on a change in pull request #3122: HDDS-6361. Modify docs build flow to replace image tags with shortcodes.

Posted by GitBox <gi...@apache.org>.
JyotinderSingh commented on a change in pull request #3122:
URL: https://github.com/apache/ozone/pull/3122#discussion_r812927414



##########
File path: hadoop-hdds/docs/dev-support/bin/generate-site.sh
##########
@@ -31,11 +31,18 @@ if git -C $(pwd) status >& /dev/null; then
   ENABLE_GIT_INFO="--enableGitInfo"
 fi
 
-# Replace all markdown images with a responsive hugo shortcode.
-python3 $DIR/make_images_responsive.py $DOCDIR
+# Copy docs files to a temporary directory inside target
+# for pre-processing the markdown files.
+TMPDIR="$DOCDIR/target/tmp"
+mkdir -p "$TMPDIR"
+rsync -a --exclude="$DOCDIR/target" --exclude="$DOCDIR/public" "$DOCDIR/" "$TMPDIR"

Review comment:
       Thank you for catching this, I have made the suggested changes.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai merged pull request #3122: HDDS-6361. Modify docs build flow to replace image tags with shortcodes.

Posted by GitBox <gi...@apache.org>.
adoroszlai merged pull request #3122:
URL: https://github.com/apache/ozone/pull/3122


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] JyotinderSingh commented on pull request #3122: HDDS-6361. Modify docs build flow to replace image tags with shortcodes.

Posted by GitBox <gi...@apache.org>.
JyotinderSingh commented on pull request #3122:
URL: https://github.com/apache/ozone/pull/3122#issuecomment-1048478871


   Thank you for your reviews @adoroszlai. These are great points, I have addressed them in my latest patch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on a change in pull request #3122: HDDS-6361. Modify docs build flow to replace image tags with shortcodes.

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #3122:
URL: https://github.com/apache/ozone/pull/3122#discussion_r812915703



##########
File path: hadoop-hdds/docs/dev-support/bin/generate-site.sh
##########
@@ -31,11 +31,18 @@ if git -C $(pwd) status >& /dev/null; then
   ENABLE_GIT_INFO="--enableGitInfo"
 fi
 
-# Replace all markdown images with a responsive hugo shortcode.
-python3 $DIR/make_images_responsive.py $DOCDIR
+# Copy docs files to a temporary directory inside target
+# for pre-processing the markdown files.
+TMPDIR="$DOCDIR/target/tmp"
+mkdir -p "$TMPDIR"
+rsync -a --exclude="$DOCDIR/target" --exclude="$DOCDIR/public" "$DOCDIR/" "$TMPDIR"

Review comment:
       Thanks @JyotinderSingh for updating the patch.
   
   Repeated `mvn package` increases the depth of the hierarchy (`target/tmp/target/tmp/target/tmp`, etc.).
   
   ```suggestion
   mkdir -p "$TMPDIR"
   rsync -a --exclude="target" --exclude="public" "$DOCDIR/" "$TMPDIR"
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org