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

Finish git dictionary #1

Open
AnderssonPeter opened this issue Nov 17, 2021 · 2 comments
Open

Finish git dictionary #1

AnderssonPeter opened this issue Nov 17, 2021 · 2 comments

Comments

@AnderssonPeter
Copy link
Owner

No description provided.

@AnderssonPeter
Copy link
Owner Author

AnderssonPeter commented Dec 26, 2021

There seems to be a xml format of the git documentation see if we can use it to bootstrap part of the dictionary!

make user-manual.xml

documentation:
    name: documentation
    needs: ci-config
    if: needs.ci-config.outputs.enabled == 'yes'
    env:
      jobname: Documentation
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - run: ci/install-dependencies.sh
    - run: ci/test-documentation.sh

@AnderssonPeter
Copy link
Owner Author

AnderssonPeter commented Jan 4, 2022

The following xslt should do the trick (some manual fixing after running it will still be required)

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<xsl:text>    [CommandParameter]@{
        Keys = @("</xsl:text>
		<xsl:value-of select="substring-after(normalize-space(./refentry/refmeta/refentrytitle), '-')"/>
		<xsl:text>");
        Name = "</xsl:text>
		<xsl:value-of select="substring-after(normalize-space(./refentry/refmeta/refentrytitle), '-')"/>
		<xsl:text>";
        Description = "</xsl:text>
		<xsl:value-of select="normalize-space(./refentry/refnamediv/refpurpose)"/>
		<xsl:text>";
        Parameters = @{
</xsl:text>
		<xsl:for-each select="refentry/*[@id='_options']/variablelist/varlistentry">
			<xsl:text>            [</xsl:text>
			<xsl:choose>
				<xsl:when test="contains(., '=')">
					<xsl:text>Value</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>Flag</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
			<xsl:text></xsl:text>
			<xsl:text>Parameter]@{</xsl:text>
			<xsl:text>
                Keys = @(</xsl:text>
			<xsl:for-each select="term">
				<xsl:text>"</xsl:text>
				<xsl:choose>
					<xsl:when test="contains(., '=')">
						<xsl:value-of select="substring-before(normalize-space(.), '=')"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="normalize-space(.)"/>
					</xsl:otherwise>
				</xsl:choose>
				<xsl:text>"</xsl:text>
				<xsl:if test="position() != last()">
					<xsl:text>, </xsl:text>
				</xsl:if>
			</xsl:for-each>
			<xsl:text>);
                Name = "</xsl:text>
			<xsl:value-of select="substring-after(normalize-space(./term[last()]), '--')"/>
			<xsl:text>";
                Description = "</xsl:text>
			<xsl:value-of select="replace(normalize-space(listitem/simpara), '&quot;', '`&quot;')"/>
<xsl:text>";
</xsl:text>
			<xsl:if test="contains(., '=')">
				<xsl:text>                Source = $???;
</xsl:text>
			</xsl:if>
			<xsl:text>            },
</xsl:text>
		</xsl:for-each>
		<xsl:text>        },</xsl:text>
	</xsl:template>
</xsl:stylesheet>

AnderssonPeter added a commit that referenced this issue Jan 8, 2022
AnderssonPeter added a commit that referenced this issue Jan 10, 2022
See also: #1
AnderssonPeter added a commit that referenced this issue Jan 10, 2022
AnderssonPeter added a commit that referenced this issue Jan 11, 2022
AnderssonPeter added a commit that referenced this issue Jan 11, 2022
See also: #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant