class_docstr: A MkDocs File object.
  
  Points to the source and destination locations of a file.
  
  The `path` argument must be a path that exists relative to `src_dir`.
  
  The `src_dir` and `dest_dir` must be absolute paths on the local file system.
  
  The `use_directory_urls` argument controls how destination paths are generated. If `False`, a Markdown file is
  mapped to an HTML file of the same name (the file extension is changed to `.html`). If True, a Markdown file is
  mapped to an HTML index file (`index.html`) nested in a directory using the "name" of the file in `path`. The
  `use_directory_urls` argument has no effect on non-Markdown files.
  
  File objects have the following properties, which are Unicode strings:
class_docstr_tok: ["A","MkDocs","File","object",".","Points","to","the","source","and","destination","locations","of","a","file",".","The","`","path","`","argument","must","be","a","path","that","exists","relative","to","`","src_dir","`",".","The","`","src_dir","`","and","`","dest_dir","`","must","be","absolute","paths","on","the","local","file","system",".","The","`","use_directory_urls","`","argument","controls","how","destination","paths","are","generated",".","If","`","False","`",",","a","Markdown","file","is","mapped","to","an","HTML","file","of","the","same","name","(","the","file","extension","is","changed","to","`",".html","`",")",".","If","True",",","a","Markdown","file","is","mapped","to","an","HTML","index","file","(","`","index.html","`",")","nested","in","a","directory","using","the","``","name","''","of","the","file","in","`","path","`",".","The","`","use_directory_urls","`","argument","has","no","effect","on","non-Markdown","files",".","File","objects","have","the","following","properties",",","which","are","Unicode","strings",":"]
docstr: Return url based in destination path.
code: def _get_url(self, use_directory_urls: bool) -> str:
      """Return url based in destination path."""
      url = self.dest_uri
      dirname, filename = posixpath.split(url)
      if use_directory_urls and filename == "index.html":
          url = (dirname or ".") + "/"
      return urlquote(url)
  
imports: from __future__ import annotations
  import enum
  import fnmatch
  import logging
  import os
  import posixpath
  import shutil
  import warnings
  from pathlib import PurePath
  from typing import TYPE_CHECKING, Callable, Iterable, Iterator, Sequence
  from urllib.parse import quote
  import pathspec
  import pathspec.gitignore
  import pathspec.util
  from mkdocs import utils
label_desc: Use image node_id 9 for calling the File obj's underlying member method code with example usage: obj._get_url(use_directory_urls) and returns: urlquote