Merge pull request #5 from mothe-at/main

Added an option to set the 2-letter language code for the Wikipedia page
This commit is contained in:
Eric David Smith
2025-05-26 06:23:32 -04:00
committed by GitHub
2 changed files with 19 additions and 0 deletions

View File

@@ -68,9 +68,18 @@ parser.add_argument(
default='yes',
help="Specify whether to download images (yes or no).",
)
parser.add_argument(
"--lang",
type=str,
default="en",
help="The 2-letter language code for the Wikipedia page (default: 'en')."
)
args = parser.parse_args()
# Set the language for Wikipedia if provided
wikipedia.set_lang(args.lang)
topic = f"{args.topic}"
download_images = args.dl_image == 'yes'

View File

@@ -47,9 +47,19 @@ parser.add_argument(
type=str,
help="The topic to generate a markdown file for.",
)
parser.add_argument(
"--lang",
type=str,
default="en",
help="The 2-letter language code for the Wikipedia page (default: 'en')."
)
args = parser.parse_args()
# Set the language for Wikipedia if provided
wikipedia.set_lang(args.lang)
topic = f"{args.topic}"
generate_markdown(topic)