How to Change The Default Alabaster Theme Of Sphinx Documentation

In this video we will learn how to change the default alabaster theme of sphinx documentation. We will be using Read the Docs theme in our own sphinx project. we will download the sphinx them from https://github.com/rtfd/sphinx_rtd_theme

https://github.com/rtfd/sphinx_rtd_theme

#sphinx  #dosc 

What is GEEK

Buddha Community

How to Change The Default Alabaster Theme Of Sphinx Documentation

A Vue 2 Component Collection for Stripe.js

Vue Stripe Elements

Flexible and powerful Vue components for Stripe. It's a glue between Stripe.js and Vue component lifecycle.

  • Vue 2 component collection: stable ✅
  • Vue 3 version: in development 🚧

Quickstart

1. Install package:

# npm
npm i vue-stripe-elements-plus --save-dev

# yarn
yarn add vue-stripe-elements-plus --dev

2. Add Stripe.js library to the page:

<script src="https://js.stripe.com/v3/"></script>

Alternatively, you can load Stripe library dynamically. Just make sure it's ready before your components mount.

3. Use built-in components

Create card

<template>
  <div class="payment-simple">
    <StripeElements
      :stripe-key="stripeKey"
      :instance-options="instanceOptions"
      :elements-options="elementsOptions"
      #default="{ elements }" // attention: important part!
      ref="elms"
    >
      <StripeElement
        type="card"
        :elements="elements"
        :options="cardOptions"
        ref="card"
      />
    </StripeElements>
    <button @click="pay" type="button">Pay</button>
  </div>
</template>

<script>
import { StripeElements, StripeElement } from 'vue-stripe-elements-plus'

export default {
  name: 'PaymentSimple',

  components: {
    StripeElements,
    StripeElement
  },

  data () {
    return {
      stripeKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx', // test key, don't hardcode
      instanceOptions: {
        // https://stripe.com/docs/js/initializing#init_stripe_js-options
      },
      elementsOptions: {
        // https://stripe.com/docs/js/elements_object/create#stripe_elements-options
      },
      cardOptions: {
        // reactive
        // remember about Vue 2 reactivity limitations when dealing with options
        value: {
          postalCode: ''
        }
        // https://stripe.com/docs/stripe.js#element-options
      }
    }
  },

  methods: {
    pay () {
      // ref in template
      const groupComponent = this.$refs.elms
      const cardComponent = this.$refs.card
      // Get stripe element
      const cardElement = cardComponent.stripeElement

      // Access instance methods, e.g. createToken()
      groupComponent.instance.createToken(cardElement).then(result => {
        // Handle result.error or result.token
      })
    }
  }
}
</script>

4. Get advanced

Create multiple elements

<StripeElements
  :stripe-key="stripeKey"
  :instance-options="instanceOptions"
  :elements-options="elementsOptions"
  #default="{ elements }" // attention: important part!
>
  <StripeElement
    type="cardNumber"
    :elements="elements"
    :options="cardNumberOptions"
  />
  <StripeElement
    type="postalCode"
    :elements="elements"
    :options="postalCodeOptions"
  />
</StripeElements>

5. Go wild

You can even create multiple groups, don't ask me why. It's possible.

<StripeElements
  :stripe-key="stripeKey1"
  :instance-options="instanceOptions1"
  :elements-options="elementsOptions1"
  #default="{ elements }" // attention: important part!
>
  <StripeElement
    :elements="elements"
    :options="cardOptions"
  />
</StripeElements>
<StripeElements
  :stripe-key="stripeKey2"
  :instance-options="instanceOptions2"
  :elements-options="elementsOptions2"
  #default="{ elements }" // attention: important part!
>
  <StripeElement
    type="iban"
    :elements="elements"
    :options="ibanOptions"
  />
</StripeElements>

Styles

No base style included. Main reason: overriding it isn't fun. Style as you wish via element options: see details.

API Reference

StripeElements.vue

Think of it as of individual group of elements. It creates stripe instance and elements object.

import { StripeElements } from 'vue-stripe-elements-plus'

props

// https://stripe.com/docs/js/initializing#init_stripe_js-options
stripeKey: {
  type: String,
  required: true,
},
// https://stripe.com/docs/js/elements_object/create#stripe_elements-options
instanceOptions: {
  type: Object,
  default: () => ({}),
},
// https://stripe.com/docs/stripe.js#element-options
elementsOptions: {
  type: Object,
  default: () => ({}),
},

data

You can access instance and elements by adding ref to StripeElements component.

// data of StripeElements.vue
instance: {},
elements: {},

default scoped slot

Elegant solution for props. Really handy because you can make instance and elements available to all children without adding extra code.

<!-- Isn't it cool? I really like it! -->
<StripeElements #default="{elements, instance}">
  <StripeElement :elements="elements" />
  <CustomComponent :instance="instance" />
</StripeElements>

StripeElement.vue

Universal and type agnostic component. Create any element supported by Stripe.

props

// elements object
// https://stripe.com/docs/js/elements_object/create
elements: {
  type: Object,
  required: true,
},
// type of the element
// https://stripe.com/docs/js/elements_object/create_element?type=card
type: {
  type: String,
  default: () => 'card',
},
// element options
// https://stripe.com/docs/js/elements_object/create_element?type=card#elements_create-options
options: {
  type: [Object, undefined],
},

data

stripeElement
domElement

options

Element options are reactive. Recommendation: don't use v-model on StripeElement, instead pass value via options.

data() {
  return {
    elementOptions: {
      value: {
        postalCode: ''
      }
    }
  }
},

methods: {
  changePostalCode() {
    // will update stripe element automatically
    this.elementOptions.value.postalCode = '12345'
  }
}

events

Following events are emitted on StripeElement

  • change
  • ready
  • focus
  • blur
  • escape
<StripeElement
  :elements="elements"
  @blur="doSomething"
/>

Helpers

In case you like the manual gearbox. Check stripeElements.js for details.

import { initStripe, createElements, createElement } from 'vue-stripe-elements-plus'

Download Details:
Author: ectoflow
Download Link: Download The Source Code
Official Website: https://github.com/ectoflow/vue-stripe-elements
License: MIT
#vue #stripe

How to Change The Default Alabaster Theme Of Sphinx Documentation

In this video we will learn how to change the default alabaster theme of sphinx documentation. We will be using Read the Docs theme in our own sphinx project. we will download the sphinx them from https://github.com/rtfd/sphinx_rtd_theme

https://github.com/rtfd/sphinx_rtd_theme

#sphinx  #dosc 

Sid  Strosin

Sid Strosin

1595897400

Auto-Documenting a Python Project Using Sphinx

While thorough documentation is necessary, it’s often put on the back burner and looked upon as a chore and a low-priority task. As a developer, it’s easy to fall back on the mindset of “why document the code when you, the author, know exactly what it’s doing?” When the code is rapidly changing, keeping the docs up to date becomes an even more substantial burden.

Luckily, manually writing out documentation is not required due to the capabilities of Sphinx, a tool that automatically generates documentation from the docstrings in your code.

Below is a step-by-step guide to easily auto-generate clean and well-organized documentation from Python code using Sphinx.

#sphinx #documentation #python

Publish Python Project Documentation on Confluence/HTML using Sphinx

In this article, We will look into the file documentation which is generated by Sphinx. This documentation generator can be used to create .pdf, .HTML or publish the technical documentation page to a Confluence instance.

#documentation #sphinx #python #confluence #html

Apply Themes to a WPF Application Using Syncfusion Theme Studio

The Theme Studio for WPF has been completely revamped to a new structure in our 2020 Volume 2 release. It helps users to transform their visual presentation into a new theme in minutes without any code or designer involvement. The following new, built-in themes have been introduced, providing a rich UI:

  • Material Light
  • Material Dark
  • Material Light Blue
  • Material Dark Blue
  • Office2019 Colorful
  • Office2019 Black

WPF Theme StudioWPF Theme Studio

Material and Office 2019 themes in WPF applications

The new Material and Office 2019 themes can be applied to an entire application, resulting in a change in the skin of the framework and the Syncfusion controls, making the application more attractive.

In this section, we will see how to apply these themes to an application step by step using the DataGrid control as an example.

How to apply themes to the Syncfusion WPF DataGrid control in your application

Follow these steps to apply themes to the Syncfusion WPF DataGrid control in your application:

Step 1: Please refer to this link to see how to get started with Syncfusion WPF DataGrid.

Step 2: Once the DataGrid is created, add the Syncfusion.SfSkinManager.WPF (Skin Manager Framework) assembly, which provides a convenient way to give both framework and Syncfusion controls an appealing appearance.

Step 3: Add the Syncfusion.Theme.MaterialDark.WPF theming assembly (or any other theming assembly of your choice) in order to use the dark theme effect. The libraries can be obtained from:

  • Essential Studio suite (installed location and GAC)
  • – Installed location: :\Program Files (x86)\Syncfusion\Essential Studio\WPF\18.2.0.44\Assemblies
  • – GAC: :\Windows\Microsoft.NET\assembly\GAC_MSIL
  • NuGet
  • – Location: https://www.nuget.org/packages

Refer to the following screenshot.

Add Syncfusion.SfSkinManager.WPF and Syncfusion.Theme.MaterialDark.WPF assembly

Step 4: Now add a reference for the Syncfusion.SfSkinManager.WPF assembly to the application and import the SfSkinManager namespace in the main window.

Refer to the following code example.

<``**Window** x:Class``=``"GettingStarted.MainWindow"

xmlns``=``"http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x``=``"http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:local``=``"clr-namespace:GettingStarted"

xmlns:syncfusion``=``"http://schemas.syncfusion.com/wpf"

xmlns:syncfusionskin``=``"clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF"``>

Step 5: Finally, set the SfSkinManager‘s attached property, VisualStyle, to “MaterialDark” for the entire window so that all the framework and Syncfusion WPF controls added to the application have the Material dark theme applied.

Refer to the following code example.

<``**Window** x:Class``=``"GettingStarted.MainWindow"

xmlns``=``"http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x``=``"http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:local``=``"clr-namespace:GettingStarted"

xmlns:syncfusion``=``"http://schemas.syncfusion.com/wpf"

xmlns:syncfusionskin ="clr-namespace:Syncfusion.SfSkinManager;``assembly``=``Syncfusion``.SfSkinManager.WPF

syncfusionskin:SfSkinManager.VisualStyle``=``"MaterialDark"``>

<``**Window.DataContext**``>

<``**local:ViewModel**``/>

</``**Window.DataContext**``>

<``**Grid**``>

<``**syncfusion:SfDataGrid** x:Name``=``"dataGrid" ItemsSource``=``"{Binding EmployeeDetails}" />

</``**Grid**``>

</``**Window**``>

After executing this code example, we will get output like the following screenshot.

"WPF

It’s that simple!

Now, you may ask, how do I change the primary colors used during hovering, selection, or other scenarios? And am I limited to built-in colors alone?

No, you ‘re not. For this, we have created our Theme Studio, where you can choose and change the primary colors as you like. Let’s see how it works.

#essential studio #syncfusion #theme #what's new #wpf #desktop #theme studio #what's new