<commit_before>{% extends "base.html" %}
{% load docstring %}

{% block title %}Search{% endblock %}
{% block pagetitle %}Search{% endblock %}

{% block content %}

<form action="{% url pydocweb.doc.views.search %}" 
      method="post">
  <ul>
    {{ form.as_ul }}
    <li><label></label>
      <input type="submit" name="button_search" id="id_search" value="Search" />
      <span style='width: 2em' />
      <a href="" onclick="submit_no_examples(); return false;">No examples</a>
      <a href="" onclick="submit_no_docs(); return false;">No documentation</a>
  </ul>
</form>

{% if docstring_results %}
<h2>Results: docstrings</h2>
{% as_table_rows 3 docstring_results as rows %}
<table class="content-list">
  {% for row in rows %}
  <tr>
    {% for item in row %}
    <td><a href="{% url pydocweb.doc.views.docstring item.0 %}">{{item.0|escape}}</a></td>
    {% endfor %}
  </tr>
  {% endfor %}
</table>
{% endif %}

{% if wiki_results %}
<h2>Results: wiki pages</h2>
{% as_table_rows 3 wiki_results as rows %}
<table class="content-list">
  {% for row in rows %}
  <tr>
    {% for item in row %}
    <td><a href="{% url pydocweb.doc.views.wiki item.0 %}">{{item.0|escape}}</a></td>
    {% endfor %}
  </tr>
  {% endfor %}
</table>
{% endif %}

{% endblock %}



{% block extra_headers %}
{{block.super}}
<script>
function submit_no_examples() {
    $("#id_fulltext").attr("value", "%Examples%");
    $("#id_invert").attr("checked", 1);
    $("#id_search").click();
}
function submit_no_docs() {
    $("#id_fulltext").attr("value", "");
    $("#id_invert").removeAttr("checked");
    $("#id_search").click();
}
</script>
{% endblock %}<commit_msg>Add canned search for all wiki pages<commit_after>{% extends "base.html" %}
{% load docstring %}

{% block title %}Search{% endblock %}
{% block pagetitle %}Search{% endblock %}

{% block content %}

<form action="{% url pydocweb.doc.views.search %}" 
      method="post">
  <ul>
    {{ form.as_ul }}
    <li><label></label>
      <input type="submit" name="button_search" id="id_search" value="Search" />
      <span style='width: 2em' />
      <a href="" onclick="submit_no_examples(); return false;">No examples</a>
      <a href="" onclick="submit_no_docs(); return false;">No documentation</a>
      <a href="" onclick="submit_all_wiki_pages(); return false;">All wiki pages</a>
  </ul>
</form>

{% if docstring_results %}
<h2>Results: docstrings</h2>
{% as_table_rows 3 docstring_results as rows %}
<table class="content-list">
  {% for row in rows %}
  <tr>
    {% for item in row %}
    <td><a href="{% url pydocweb.doc.views.docstring item.0 %}">{{item.0|escape}}</a></td>
    {% endfor %}
  </tr>
  {% endfor %}
</table>
{% endif %}

{% if wiki_results %}
<h2>Results: wiki pages</h2>
{% as_table_rows 3 wiki_results as rows %}
<table class="content-list">
  {% for row in rows %}
  <tr>
    {% for item in row %}
    <td><a href="{% url pydocweb.doc.views.wiki item.0 %}">{{item.0|escape}}</a></td>
    {% endfor %}
  </tr>
  {% endfor %}
</table>
{% endif %}

{% endblock %}



{% block extra_headers %}
{{block.super}}
<script>
function select_type(value) {
    $("#id_type_ option").removeAttr('selected');
    $("#id_type_ option[value=" + value + "]").attr('selected', 1);
}
function get_type() {
    return $("#id_type_ option[selected]").attr('value');
}
function submit_no_examples() {
    $("#id_fulltext").attr("value", "%Examples%");
    $("#id_invert").attr("checked", 1);
    if (get_type() == 'wiki') { select_type('any'); }
    $("#id_search").click();
}
function submit_no_docs() {
    $("#id_fulltext").attr("value", "");
    $("#id_invert").removeAttr("checked");
    if (get_type() == 'wiki') { select_type('any'); }
    $("#id_search").click();
}
function submit_all_wiki_pages() {
    $("#id_fulltext").attr("value", "%");
    $("#id_invert").removeAttr("checked");
    select_type('wiki');
    $("#id_search").click();
}
</script>
{% endblock %}
{'fraction_non_alphanumeric': 0.2293997965412004, 'fraction_numerical': 0.006358087487283825, 'mean_word_length': 4.042307692307692, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3720708', 'n_tokens_mistral': 1498, 'n_tokens_neox': 1363, 'n_words': 295}