o
    Ü!d­
  ã                   @   s*   d Z ddlZddlZe e¡Zdd„ ZdS )aZ  
Add authored examples to MAN and HTML documentation
---------------------------------------------------

This customization allows authored examples in ReST format to be
inserted into the generated help for an Operation.  To get this to
work you need to:

* Register the ``add_examples`` function below with the
  ``doc-examples.*.*`` event.
* Create a file containing ReST format fragment with the examples.
  The file needs to be created in the ``examples/<service_name>``
  directory and needs to be named ``<service_name>-<op_name>.rst``.
  For example, ``examples/ec2/ec2-create-key-pair.rst``.

é    Nc              	   K   sÂ   t j t j t j t j t¡¡¡d¡}t j || j dt jj¡¡}|d }t	 
d|¡ t j |¡r]| jj d¡ | jj ¡  d}| j |¡ | jj ¡  t|ƒ}| ¡ D ]
}| j |¡ qTd S d S )NÚexamplesÚ.z.rstzLooking for example file at: %sZExamplesaJ  <p>To use the following examples, you must have the AWS CLI installed and configured. See the <a href='https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-quickstart.html'>Getting started guide</a> in the <i>AWS CLI User Guide</i> for more information.</p><p>Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal's quoting rules. See <a href='https://docs.aws.amazon.com/cli/v1/userguide/cli-usage-parameters-quoting-strings.html'>Using quotation marks with strings</a> in the <i>AWS CLI User Guide</i>.</p>)ÚosÚpathÚjoinÚdirnameÚabspathÚ__file__Zevent_classÚreplaceÚsepÚLOGÚdebugÚisfileÚdocÚstyleZh2Z
start_noteZinclude_doc_stringZend_noteÚopenÚ	readlinesÚwrite)Zhelp_commandÚkwargsZdoc_pathÚmsgÚfpÚline© r   úEusr/lib/python3.10/site-packages/awscli/customizations/addexamples.pyÚadd_examples$   s0   
ÿÿýÿîr   )Ú__doc__r   ÚloggingÚ	getLoggerÚ__name__r   r   r   r   r   r   Ú<module>   s
   
