diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 7d4f074b9..c31b19a21 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -93,6 +93,18 @@ jobs: lua luadocumentor.lua -d ${{ github.workspace }}/build/doc "${{ github.workspace }}/Moose Development/Moose" working-directory: ${{ github.workspace }}/build/tools/luadocumentor + ######################################################################### + # Replace tag + ######################################################################### + - name: Replace head tag + run: | + python3 "${{ github.workspace }}/Moose Development/docs-header.py" + working-directory: ${{ github.workspace }}/build/doc + + - name: Check replacement of head tag + run: | + head -10 ${{ github.workspace }}/build/doc/AI.AI_A2A_Cap.html + ######################################################################### # Push to MOOSE_DOCS ######################################################################### diff --git a/Moose Development/docs-header.html b/Moose Development/docs-header.html new file mode 100644 index 000000000..e6613e196 --- /dev/null +++ b/Moose Development/docs-header.html @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Moose Development/docs-header.py b/Moose Development/docs-header.py new file mode 100644 index 000000000..72dfc6f28 --- /dev/null +++ b/Moose Development/docs-header.py @@ -0,0 +1,26 @@ +# import required module +from pathlib import Path +import os + +# assign directory +directory = '.' + +print( "Replacing head tag in all html files" ) + +# Read template file +with open( os.path.dirname(__file__) + '/docs-header.html', 'r') as file: + newhead = file.read() + +# iterate over files in +# that directory +files = Path(directory).glob('*.html') +for file in files: + # print(file) + with open(file, 'r') as fileread: + filedata = fileread.read() + # Replace the target string + filedata = filedata.replace( '', newhead ) + + # Write the file out again + with open(file, 'w') as filewrite: + filewrite.write(filedata)